How to plot errorbar with only upper error bars?
11 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Guy Doron
le 14 Sep 2011
Commenté : Wolfgang Klassen
le 2 Oct 2019
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
0 commentaires
Réponse acceptée
Daniel Shub
le 14 Sep 2011
The simplest way might be to do:
errorbar(X,Y,zeros(size(Y)),U)
you could also hack the code to not plot the lower bar at all
edit errorbar
0 commentaires
Plus de réponses (1)
Örs Szalontai
le 13 Déc 2016
Modifié(e) : Örs Szalontai
le 13 Déc 2016
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 commentaire
Wolfgang Klassen
le 2 Oct 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.
Voir également
Catégories
En savoir plus sur Errorbars dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!