Plot with error bars to show upper and lower bounds

13 visualizaciones (últimos 30 días)
Cara Fertitta
Cara Fertitta el 2 de Nov. de 2017
Comentada: Star Strider el 2 de Nov. de 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?

Respuesta aceptada

Star Strider
Star Strider el 2 de Nov. de 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 comentarios
Cara Fertitta
Cara Fertitta el 2 de Nov. de 2017
Thanks for clarifying!
Star Strider
Star Strider el 2 de Nov. de 2017
As always, my pleasure!
I apologise for the earlier confusion.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Errorbars en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by