How do I plot multiple individual y-values on a single x-value?

조회 수: 10 (최근 30일)
Dominika Slusna
Dominika Slusna 2017년 12월 30일
댓글: Stuart-James Burney 2020년 7월 1일
Good evening!
I´d like to plot multiple individual y-values on a single x-value. Something like the drawing I attached where every dot represents an individual value. X-axis should not represent any value, but rather it´s one variable with various categories. For example, x-axis should show gesture type, while y-axis individual frequencies of q particular gesture type.

답변 (1개)

Sujit Muduli
Sujit Muduli 2018년 1월 4일
Hi Dominika,
As of now, MATLAB plotting functions do not support. However, for your particular use case, you may try using 'subplot' function as follow.
in = {[1 2 3 4 8 9], [1 5 9], [4 6 8 9 12]}
titles = {'first','second','third'}
for i = 1:length(in)
subplot(1,length(in), i);
scatter(ones(1,length(in{i})), in{i},'filled')
set(gca,'XTick',[])
xlabel(titles{i});
end
  댓글 수: 1
Stuart-James Burney
Stuart-James Burney 2020년 7월 1일
Is there a way to plot the same data on a single axis (i.e. make a single plot as opposed to three)?

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Line Plots에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by