plot a single Error bars
14 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Nikolas Spiliopoulos
le 11 Sep 2019
Commenté : dpb
le 16 Sep 2019
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
Nikolas
5 commentaires
Adam Danz
le 13 Sep 2019
(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.
Réponse acceptée
Prabhan Purwar
le 16 Sep 2019
Hi,
Bar chart can be created by making use of bar and errorbar functions as shown in the following code.
x=1; y=8.35;
sd=4.13;
bar(x,y);
hold on
errorbar(x,y,sd)
ylim([0 14])
xticks([0:2])
hold off
Output:
![untitled.jpg](https://www.mathworks.com/matlabcentral/answers/uploaded_files/238494/image.jpeg)
Please refer the following link for further information on errorbarfunction
1 commentaire
dpb
le 16 Sep 2019
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.
Plus de réponses (0)
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!