MATLAB Answers

plot a single Error bars

64 ビュー (過去 30 日間)
Nikolas Spiliopoulos
Nikolas Spiliopoulos 2019 年 9 月 11 日
コメント済み: dpb 2019 年 9 月 16 日
Hi all,
I am trying to create one error bar but I am struggling a lot.
I tried to read the matlab documentation about error bars but the site is down for some reason.
Anyway, I have calculate the standard deviaiton (s=4.13) but I am confused witht the x,y axes
the x axis should be 1 value and the y axis has a range from 0 to 14
please let me know what you think
many thanks

  5 件のコメント

表示 2 件の古いコメント
dpb 2019 年 9 月 13 日
Well, you must have an ordinate point which is the "y" as a minimum as well as an associated error value for any plot, the abscissa can be omitted in which case will be the ordinal number by default. errorbar is no different than plot in that regards.
You didn't provide any information other than a computed std deviation value; I just made up a pair of x,y values for the example that would fit into the ylim range you did indicate.
linespec is defined same as for plot, just add the triplet letters for marker, color, line as wanted.
Adam Danz
Adam Danz 2019 年 9 月 13 日
(x,y) are the coordinate you're adding the error bar to.
neg and pos the lower and upper length of the error bar.
so, this line
errorbar(3,4,1,2, 'o')
plots a point at (3,4) and the errorbar extens downward by 1 y-unit and upward by 2 y-units.
Nikolas Spiliopoulos
Nikolas Spiliopoulos 2019 年 9 月 14 日
Alright, thanks a lot I am gonna have a look at website too!!



Prabhan Purwar
Prabhan Purwar 2019 年 9 月 16 日
Bar chart can be created by making use of bar and errorbar functions as shown in the following code.
x=1; y=8.35;
hold on
ylim([0 14])
hold off
Please refer the following link for further information on errorbarfunction
Hope this helps

  1 件のコメント

dpb 2019 年 9 月 16 日
Ah! Maybe THAT was what OP mean by "how to get a bar instead of *"...I couldn't figure that one out and there was no further input.


その他の回答 (0 件)


Community Treasure Hunt

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

Start Hunting!

Translated by