How to plot the max and min of a data set on a bar plot that is constructed from mean values ?
11 views (last 30 days)
Show older comments
I have been trying to plot the max and min of a data on a bar plot generated from the mean values of the same data. barwitherr doesn't seem to work for me. I have a 51*5 matrix and have generated the bar plot by taking the mean of that matrix along every column. Now I want to plot the max and min value of every column on the same bar plot. I want something like that:
However the only difference in my case would be that instead of %error, the error bars will be presenting the max and min value. The code I used to generate the bar plot:
h=figure;
bar([1 2 3 4 5],[OS_1' OS_2']);
legend('OS-1','OS-2');
set(gca,'XTickLabel',{'5kWh','10kWh','15kWh','20kWh','25kWh'});
title('Pgrid,max = 30% of Installed power','FontSize',14);
ylabel('Ploss','FontSize',14);
xlabel('Storage Capacity','FontSize',14);
Thanks in advance :)
0 Comments
Answers (1)
Amit
on 21 Jan 2014
Something like this might work for you: http://www.mathworks.com/matlabcentral/fileexchange/30639-bar-chart-with-error-bars
0 Comments
See Also
Categories
Find more on Annotations 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!