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

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;
Answers (1)
KSSV
on 15 Oct 2018
figure
hold on
N = 10 ;
bar(rand(10,1))
plot(repelem(4.5,1,N),linspace(0,1,N))
2 Comments
Evgeniia Diachek
on 15 Oct 2018
KSSV
on 15 Oct 2018
I gave you a pseudo code on plotting a line on bar graph. You have to extend it in your case.
Categories
Find more on Scatter Plots in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!