Plot with error bars to show upper and lower bounds

18 Ansichten (letzte 30 Tage)
Cara Fertitta
Cara Fertitta am 2 Nov. 2017
Kommentiert: Star Strider am 2 Nov. 2017
I'm looking to generate a plot where the upper and lower bounds of the data are displayed above and below the mean. There is a package that allows you to plot the upper and lower boundaries of a curve, but I would like to do this for a scatter plot. To my knowledge, I can't use errorbar, because the anticipated inputs are standard deviations. What I need is something that frames the upper and lower bounds of the data. For instance if the mean = 10, the lower bound may be 7 and the upper bound may be 15. Ideally, in this hypothetical situation, I want a point at 10 and bar that extends from 7 to 15. Any suggestions?

Akzeptierte Antwort

Star Strider
Star Strider am 2 Nov. 2017
The errorbar error bar limits can be anything you want them to be. They are not restricted to be standard deviations or anything else.
Example
x = 1:10; % Create Data
y = randi(9, 1, 10); % Create Data
ub = y + randi(5, 1, 10); % Create Data: Upper Bound
lb = y - randi(3, 1, 10); % Create Data: Lower Bound
figure(1)
errorbar(x, y, lb, ub, 'pg')
axis([0 11 ylim])
  4 Kommentare
Cara Fertitta
Cara Fertitta am 2 Nov. 2017
Thanks for clarifying!
Star Strider
Star Strider am 2 Nov. 2017
As always, my pleasure!
I apologise for the earlier confusion.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Errorbars finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by