How do I add lines between individual scatter points in a bar graph?

조회 수: 4 (최근 30일)
Evgeniia Diachek
Evgeniia Diachek 2018년 10월 15일
댓글: KSSV 2018년 10월 15일
The picture of the plot is attached. I need to add lines between the individual scatter points within each bar group, so there will be 4 lines for each bar group.
Here is the part of the code for the scatter plot:
% code
for i = 1:12
scatter(x(i).* ones(length(num(i,:)),1),num(i,:),'*','MarkerEdgeColor',[0.20 0.21 0.22])
end;

답변 (1개)

KSSV
KSSV 2018년 10월 15일
figure
hold on
N = 10 ;
bar(rand(10,1))
plot(repelem(4.5,1,N),linspace(0,1,N))
  댓글 수: 2
Evgeniia Diachek
Evgeniia Diachek 2018년 10월 15일
This code doesn't quite work. I have 8 individual scatter points in a group of bars. I need to connect them, so there are 4 lines in each bar group.
KSSV
KSSV 2018년 10월 15일
I gave you a pseudo code on plotting a line on bar graph. You have to extend it in your case.

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

카테고리

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

제품

Community Treasure Hunt

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

Start Hunting!

Translated by