HERRORBAR Horizontal Error bar plot.
HERRORBAR(X,Y,L,R) plots the graph of vector X vs. vector Y with horizontal error bars specified by the vectors L and R. L and R contain the left and right error ranges for each point in X. Each error bar is L(i) + R(i) long and is drawn a distance of L(i) to the right and R(i) to the right the points in (X,Y). The vectors X,Y,L and R must all be the same length. If X,Y,L and R are matrices then each column produces a separate line.
HERRORBAR(X,Y,E) or HERRORBAR(Y,E) plots X with error bars [X-E X+E].
HERRORBAR(...,'LineSpec') uses the color and linestyle specified by the string 'LineSpec'. See PLOT for possibilities.
x = 1:10;
y = sin(x);
e = std(y)*ones(size(x));
This code was originally posted to the newsgroup, comp.soft-sys.matlab, by me. In 2003 Greg Aloe (The MathWorks) rightfully decided to take ownership, after several unsuccesfull attempts to contact me, and put it on the FEX so that others could benefit from it.
In 2006 I contacted Greg Aloe and we decided to return ownership to me.
I like to thank him for his efforts. Jos
Jos (10584) (2022). HERRORBAR (https://www.mathworks.com/matlabcentral/fileexchange/3963-herrorbar), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform CompatibilityWindows macOS Linux
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!