1 Download
Updated 06 Sep 2005
No License
BarsWithError
This function plots standard bar plots with corresponding errorbars. The need for such a function has been great for me especially to quickly visualize data.
Y = [1:1:10;2:2:20];
YError = [1 1 1 1 1 1 1 1 1 1 ; 2 2 2 2 2 2 2 2 2 2];
[hBars,hError] = BarsWithError(Y,YError,YError,'random',{'Group 1','Group 2'},'Sample Bar Chart')
Neatly plots Bar plots with corresponding errorbars which are also fed into the function, future versions will take as input only a matrix and errorbars will be calculated in situ. I hope the script is useful for all other users. I cannot be responsible for gray hair, financial gain or loss from this function.
Chandramouli Chandrasekaran (2021). BarsWithError (https://www.mathworks.com/matlabcentral/fileexchange/8421-barswitherror), MATLAB Central File Exchange. Retrieved .
Inspired: superbar, barerrorbar(varargin)
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Create scripts with code, output, and formatted text in a single executable document.
Very useful, considering that Matlab does not have a function that does this...
Very good but need to be improved! The colors of the legend are inconsistent with the colors of the plot!
Need to change
set(gca,'xtick',[0:1:size(Y,1)+1],'xticklabel',strvcat('',xlabels(end:-1:1),''));
with
set(gca,'xtick',[0:1:size(Y,1)+1],'xticklabel',strvcat('',strvcat(xlabels),''));
To get correct x tick labels
Very useful. Thanks alot.
I have been looking for a function like this couldn't believe it wasn't standard. Thanks