필터 지우기
필터 지우기

Plotting average value with max-min area

조회 수: 8 (최근 30일)
Marco Gualtieri
Marco Gualtieri 2021년 12월 2일
댓글: Marco Gualtieri 2021년 12월 3일
Hello everyone,
I am having some trouble with MATLAB plots. I have successfully created an array
Cn_range=zeros(3,11);
and I filled it with minimum values in the first line, average values in the second line and maximum values in the third. What I need to plot is a solid line with the average values and a "shaded" range behind that, the boundaries of which are defined by the max and min values. I know all the "hold on" stuff, but I cannot find a plotting function for the shaded range behind. Is there anything that I could use to do that?
Thank you in advance for your attention and help.

답변 (1개)

KALYAN ACHARJYA
KALYAN ACHARJYA 2021년 12월 2일
편집: KALYAN ACHARJYA 2021년 12월 2일
c_color=['r','m','y'];
for i=3:-1:1
p=Cn_range(i,:);
plot(p);
area(p,'FaceColor',c_color(i));
hold on;
end
Example:
Hope it helps!
  댓글 수: 3
KALYAN ACHARJYA
KALYAN ACHARJYA 2021년 12월 3일
편집: KALYAN ACHARJYA 2021년 12월 3일
"the only issue is that I would like the colored area to have its center in the average value"
Yes, just get the average of the particular rows and plot with marker
"not to start from 0"
The shown plot just an example, please use axis tight funtion to fit the axes as per data.
axis tight
Hope I understand your question.
Marco Gualtieri
Marco Gualtieri 2021년 12월 3일
Thank you again for your answer, maybe I didn't explain myself too well. I am trying to obtain something like what you can see in the attached image.

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

카테고리

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

태그

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by