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

 채택된 답변

Tom Lane
Tom Lane 2012년 5월 27일

32 개 추천

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

Marcos  Luis Fernadez
Marcos Luis Fernadez 2015년 11월 27일
편집: Marcos Luis Fernadez 2015년 11월 27일
It's really nice Tom!!! Thanks!! Then You can use: ...alpha(.5). From 0 to 1 modify the transparency!
Mitchell Thayer
Mitchell Thayer 2016년 10월 20일
Excellent solution; this is exactly what I was looking for today. Thanks, Tom!!
Justin Lines
Justin Lines 2016년 11월 25일
This is awesome, such a big help
Veena Chatti
Veena Chatti 2020년 9월 1일
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!

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Oleg Komarov
Oleg Komarov 2012년 5월 27일

4 개 추천

You can choose one of the following in the FEX:
User defined functions have to be placed into a folder and that folder should be added to the MATLAB path. See addpath(), savepath() or on the menu bar File > Set path

카테고리

도움말 센터File Exchange에서 Creating, Deleting, and Querying Graphics Objects에 대해 자세히 알아보기

태그

질문:

2012년 5월 27일

댓글:

2020년 9월 1일

Community Treasure Hunt

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

Start Hunting!

Translated by