필터 지우기
필터 지우기

Plot continuous standard deviation with shaded color

조회 수: 38 (최근 30일)
Jeanne Dury
Jeanne Dury 2022년 12월 13일
답변: Amit Dhakite 2023년 2월 15일
I would like to plot angle mean evolution during a jump with the continous standard deviation like this example :
For the moment, I can't color the standard deviation area :
Do you know how I can plot my standard deviation as a shaded area ?
Thank you.

답변 (1개)

Amit Dhakite
Amit Dhakite 2023년 2월 15일
Hi Jeanne,
As per my understanding, you want to shade the area representing the standard deviation with a different colour.
You can consider the following example to fill colour between two different plots:
x = 1 : 20;
% curve1 and curve2 representing the data and its deviation
curve1 = sin(x);
curve2 = sin(x) + 0.5;
plot(x, curve1, 'r', 'LineWidth', 2);
hold on;
plot(x, curve2, 'b', 'LineWidth', 2);
x2 = [x, fliplr(x)];
inBetween = [curve1, fliplr(curve2)];
fill(x2, inBetween, [1 0.7 1]);
For further information on the functions used in the code, kindly refer to the following links:

카테고리

Help CenterFile Exchange에서 MATLAB에 대해 자세히 알아보기

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by