Hi all, i want to plot the mean of a track with the standard deviation. I tried this, by using the function errorbar, This is acceptable, but I was looking for something different, such as a continuous band. Something like this one:
Thanks, M

 Respuesta aceptada

Tom Lane
Tom Lane el 27 de Mayo de 2012

32 votos

You may be able to modify this to suit your needs:
x = linspace(0,1,20)';
y = sin(x);
dy = .1*(1+rand(size(y))).*y; % made-up error values
fill([x;flipud(x)],[y-dy;flipud(y+dy)],[.9 .9 .9],'linestyle','none');
line(x,y)

4 comentarios

Marcos  Luis Fernadez
Marcos Luis Fernadez el 27 de Nov. de 2015
Editada: Marcos Luis Fernadez el 27 de Nov. de 2015
It's really nice Tom!!! Thanks!! Then You can use: ...alpha(.5). From 0 to 1 modify the transparency!
Mitchell Thayer
Mitchell Thayer el 20 de Oct. de 2016
Excellent solution; this is exactly what I was looking for today. Thanks, Tom!!
Justin Lines
Justin Lines el 25 de Nov. de 2016
This is awesome, such a big help
Veena Chatti
Veena Chatti el 1 de Sept. de 2020
WOW. Thanks. No file downloads, no mess, no fuss, no fretting about learning another programming language or environment, or exporting a bunch of data elsewhere...Just five simple lines of code and the relief of saving a whole lot of tedium to make something seemingly simple work!

Iniciar sesión para comentar.

Más respuestas (1)

Categorías

Más información sobre Creating, Deleting, and Querying Graphics Objects en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 27 de Mayo de 2012

Comentada:

el 1 de Sept. de 2020

Community Treasure Hunt

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

Start Hunting!

Translated by