How to plot errorbar with only upper error bars?
조회 수: 11 (최근 30일)
이전 댓글 표시
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
채택된 답변
Daniel Shub
2011년 9월 14일
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
추가 답변 (1개)
Örs Szalontai
2016년 12월 13일
편집: Örs Szalontai
2016년 12월 13일
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
Wolfgang Klassen
2019년 10월 2일
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.
참고 항목
카테고리
Help Center 및 File Exchange에서 Errorbars에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!