user2861089
user2861089

Reputation: 1235

Error bars on log scale using errorbarxy in matlab

In matlab I am using errorbarxy to plot x and y error bars. However, with a log scale on both x and y axes, the error bars do not look right - i.e. the error bar 'heads' are different sizes. How can I fix this?

X = 10 * rand(7,1);
Y = 10 * rand(7,1);
ux = rand(7,1);
uy = rand(7,1);
lx = rand(7,1);
ly = rand(7,1);
errorbarxy(X,Y,ux,uy,lx,ly,'Color','k','LineStyle','none','Marker','o','MarkerFaceColor','w','MarkerSize',11);
set(gca,'YScale','log');
set(gca,'XScale','log');
print -r600 -dtiff myplot.tif

enter image description here

Upvotes: 1

Views: 1150

Answers (1)

Ofer Fridman
Ofer Fridman

Reputation: 61

I suppose you can use ploterr instead.

from the documentation: The following features are supported:

  • linear/logarithmic scaling
  • x and/or y error bars
  • relative/absolute errors
  • width of bar handles adjustable

Upvotes: 1

Related Questions