필터 지우기
필터 지우기

several shaded areas between temporal series

조회 수: 1 (최근 30일)
Mireia Fontanet
Mireia Fontanet 2018년 12월 19일
댓글: Yingjun Zhang 2020년 1월 19일
Dear,
I am trying to plot several shaded areas with diferent temporal series. I've copied my code and attached my result:
A=xlsread('T.xlsx');
x = A(:,1);
MZ1=A(:,2);
MZ2=A(:,3);
min1=A(:,7);
max1 = A(:,8);
min2=A(:,9);
max2 = A(:,10);
figure
plot(x,MZ1,x, min1, x, max1,x,min2,x,max2,x,MZ2);
fill([x.',fliplr(x.')], [min1.',fliplr(max1.')], 'r')
fill([x.',fliplr(x.')], [min2.',fliplr(max2.')], 'g')
I have 2 problems:
  1. The code represents just a shaded area (in this case I have two areas.)
  2. I have two lines, representing the max and min average. They are not represented by my code.
Thanks,
shadedarea.png
  댓글 수: 1
Image Analyst
Image Analyst 2018년 12월 19일
편집: Image Analyst 2018년 12월 19일
Where is the second area?
Exactly what does "the max and min average" mean? What is a "min average"?
In general, if you have two curves, you can have multiple areas
  1. The region above curve 1
  2. The region above curve 2
  3. The region above the curve that is topmost at any x location
  4. The region below curve 1
  5. The region below curve 2
  6. The region below the curve that is bottommost at any x location
  7. The in-between region where curve 1 is above curve 2
  8. The in-between region where curve 1 is below curve 2
  9. The in-between region regardless of which curve is on top.
Please tell us what numbers, from the list above, you want shaded, and which color should go with which numbered region.

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

답변 (1개)

Mireia Fontanet
Mireia Fontanet 2018년 12월 20일
I explian what mean each colum and I have attached the excel file:
A=xlsread('T.xlsx');
x = A(:,1); %time
MZ1=A(:,2); %average area 1
MZ2=A(:,3); %average area 2
min1=A(:,4); %minimum value area 1
max1 = A(:,5); %maximum value area 1
min2=A(:,6); %minimum value area 2
max2 = A(:,7); %maximum value area 2
figure
plot(x,MZ1,x, min1, x, max1,x,min2,x,max2,x,MZ2);
fill([x.',fliplr(x.')], [min1.',fliplr(max1.')], 'r')
fill([x.',fliplr(x.')], [min2.',fliplr(max2.')], 'g')
  댓글 수: 1
Yingjun Zhang
Yingjun Zhang 2020년 1월 19일
Try below
fill([x.',fliplr(x.')], [min1.',fliplr(max1.')], 'r')
hold on
fill([x.',fliplr(x.')], [min2.',fliplr(max2.')], 'g')

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

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by