No BSD License  

Highlights from
BarsWithError

4.6

4.6 | 5 ratings Rate this file 2 Downloads (last 30 days) File Size: 4.03 KB File ID: #8421
image thumbnail

BarsWithError

by Chandramouli Chandrasekaran

 

03 Sep 2005 (Updated 06 Sep 2005)

Plots Bar plots of Data with corresponding errorbars.

| Watch this File

File Information
Description

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.

Acknowledgements
This submission has inspired the following:
barerrorbar
MATLAB release MATLAB 7.0.4 (R14SP2)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (5)
10 Sep 2005 Andrew Severin

I have been looking for a function like this couldn't believe it wasn't standard. Thanks

15 Oct 2005 ron milo

Very useful. Thanks alot.

03 Nov 2005 Fabiano Baroni

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

19 Dec 2005 John Liu

Very good but need to be improved! The colors of the legend are inconsistent with the colors of the plot!

06 Dec 2006 Ikaro Silva

Very useful, considering that Matlab does not have a function that does this...

Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
annotation Chandramouli Chandrasekaran 22 Oct 2008 07:59:21
customization Chandramouli Chandrasekaran 22 Oct 2008 07:59:21
errorbars Chandramouli Chandrasekaran 22 Oct 2008 07:59:21
bar plot Chandramouli Chandrasekaran 22 Oct 2008 07:59:21
together Chandramouli Chandrasekaran 22 Oct 2008 07:59:21
graphics Chandramouli Chandrasekaran 22 Oct 2008 07:59:21
graph type Chandramouli Chandrasekaran 22 Oct 2008 07:59:21

Contact us at files@mathworks.com