Plotting mean values with standard deviation and min/ max values

7 ビュー (過去 30 日間)
Joseff Saunders
Joseff Saunders 2019 年 2 月 12 日
回答済み: Lester Wang 2019 年 5 月 15 日
Hello all, I was wondering if it is possible to plot the mean of a set of values as a scatter, add the standard deviation as a bar and then the min/ max values as error bars on one graph? I've attached an example from a paper for visualisation. Thanks in advance for any help.
dispStatPlot.png

回答 (1 件)

Lester Wang
Lester Wang 2019 年 5 月 15 日
boxplot will do.
x = [Jan Feb ... ] ; % assume Jan, Feb are column vectors that contain the data with the same length.
figure;boxplot(x); % will plot something similar to what you want.
Noted that there are many options you can play with, e.g. 'boxstyle', 'color','width', 'whisker'.
The edges of the box are 25th and 75th percentiles. There is no direct way to modify this.

Community Treasure Hunt

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

Start Hunting!

Translated by