How to plot errorbar with only upper error bars?
Ältere Kommentare anzeigen
I am trying to plot error bars using the errorbar function. When using the errorbar(X,Y,L,U) and providing L with NaNs and U with the requested values it does not show the error bar line (just upper limit short line). I will appreciate any advice or function which allows plotting only upper error bar lines
Thanx in advance
Guy
Akzeptierte Antwort
Weitere Antworten (1)
Örs Szalontai
am 13 Dez. 2016
Bearbeitet: Örs Szalontai
am 13 Dez. 2016
0 Stimmen
Dear Everyone!
I am a really amateur user of MATlab, however, I still didn't understand (after hours) how the L and U values are calculated! Can someone explain why 'errorbar(X,Y,L,U)("which are the same lengths as the others) as previously described https://www.mathworks.com/matlabcentral/answers/15842-how-to-plot-errorbar-with-only-upper-error-bars here why does not work? I cannot imagine where from matlab generates these L and U values and why them are misplaced in plotting(which were perfectly working when I used 'errorbar(Y,E)'? How can I generate the exact L and U coordinates to place the only UPPER error bars? Anything! Thanks!
All yours, an amateur!
1 Kommentar
Wolfgang Klassen
am 2 Okt. 2019
This is a super late reply to an old topic, but here goes.
'L' and 'U' are not calculated by Matlab, they are user provided. When you use 'errorbar(Y,E)' you are telling Matlab to plot values Y, and also plot a bar going up from Y an amount E and a bar going down from Y an amount E. E represents how far above and below the data the error bars go.
If you want to have the bars going up be larger than the bars going down, you use 'errorbar(X,Y,L,U)' to specify an error bar going up from Y by an amount U, and going down from Y an amount L. Having no lower error bars is a special instance of this, where you provide a list of zeroes as L.
Kategorien
Mehr zu Errorbars finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!