scatter plot with showing their means and error bars
52 views (last 30 days)
Show older comments
Hello,
I would like to draw following graphs with Matlab. Any suggestions would be appreciated.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/343522/image.png)
0 Comments
Answers (1)
Sudheer Bhimireddy
on 9 Aug 2020
doc errorbar
Look at the matlab example: "plot error bars with no line".
2 Comments
Sudheer Bhimireddy
on 10 Aug 2020
You can plot all your points in each category (from the image you posted, it seems that each x-tick is a category) and use 'hold on', then draw the plot with at mean values with errorbars.
plot(x1,z1,'ro','MarkerFaceColor','w'); %<- this shows all points
hold on;
errorbar(1,z1_mean,z1_std,'-ro','MarkerSize',10,...
'MarkerEdgeColor','r','MarkerFaceColor','r'); %<- this shows mean with standard deviation
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/343846/image.png)
See Also
Categories
Find more on Discrete Data Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!