| Description |
BarrError combines the functions 'bar' and 'errorbar' in a single function. As far as I know, 'errorbar' cannot accomodate several bars per X point (as 'bar' does), so is not easy to plot one of the most common graph types (at least in natural sciences). 'BarError' tries to fill this gap.
Sintax:
barerror(X,Y,E,width,ycolor,ecolor,varargin)
x: vector of X values
y: vector or matrix of Y values
e: vector or matrix of error values (plotted simmetrically)
width: bar width
ycolor: one-letter color code for the bar
ecolor: one-letter color code for the error bar
Warnings
Vector x, and vector/array y and e must be the same length
y and e must have the same number of columns if they are arrays
Length of ycolor and ecolor must be equal to the number of columns of y and e
Example:
x= (1:5)';
y= 20*rand(length(x),3);
e= rand(length(x),3);
ycolor= ['b','r','g'];
ecolor= ['k','k','k'];
labels= {'G1','G2','G3','G4','G5'};
barerror(x,y,e,1,ycolor,ecolor,labels); |