File Exchange

image thumbnail


version (688 Bytes) by Nils Sjöberg
Errorbars for both x and y data.


Updated 12 Jul 2004

No License

The function plots x and y data with errorbars for both.




x=array of xdata
y=array of ydata
xerror=array of errors for x
yerror=array of errors for y
s=string argument for plotting the datapoints, The errorbars are plotted in red and blue


Needs a figure to plot in.
errorbars are symmetrical, that means that the function plots [x-xerror x+xerror] and [y-yerror y+yerror].

x,y,xerror,yerror must all be arrays.

Cite As

Nils Sjöberg (2021). xyerrorbar (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (8)

giuseppe fustaino

Matthias Imboden

Antoine Naert

Worked perfectly well at the first try, thank you!


Useful tool, thanks.

Mark S.

Qi An

Nice work except for a minor bug.

William Murphy

Did exactly what I needed to do for today. Thanks for the function.

Mohsin Siddique

Great tool. very helpful. thanks for upload

MATLAB Release Compatibility
Created with R13
Compatible with any release
Platform Compatibility
Windows macOS Linux

Inspired: errbar, errorbarxy, superbar

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!