How to plot errorbar with only upper error bars?

11 ビュー (過去 30 日間)
Guy Doron
Guy Doron 2011 年 9 月 14 日
コメント済み: Wolfgang Klassen 2019 年 10 月 2 日
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

採用された回答

Daniel Shub
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

その他の回答 (1 件)

Örs Szalontai
Ö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
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 ExchangeErrorbars についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by