Negative data ignored in adding errorbars to plot with logarithmic y axis

1 Ansicht (letzte 30 Tage)
I have two sets of data which I am trying to plot with error bars. When I plot the data, the error bars do not plot fully (see image).
"Warning: Negative data ignored"
Here are my data sets:
x=2:8;
y1=[84 4.5e3 3.1e4 5.3e4 1.1e5 1.05e5 6.5e3];
y2=[.22 .07 .14 .2 .07 .02 .27];
y1stderr=[.28 410 7.7e3 3.4e5 4.15e4 5.5e4 3.1e5];
y2stderr=[0.24 .15 .14 .08 .23 .28 .18];
figure
hold on
plot(x,y1,'b',x,y2,'r')
errorbar(x,y1,y1stderr,'b')
errorbar(x,y2,y2stderr,'r')
set(gca,'YScale','log')
axis([0, 8, .001, 500000])
I imagine the problem is with plotting an imaginary component of the errorbar. How do I get around this?

Antworten (0)

Kategorien

Mehr zu Errorbars finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by