- The region above curve 1
- The region above curve 2
- The region above the curve that is topmost at any x location
- The region below curve 1
- The region below curve 2
- The region below the curve that is bottommost at any x location
- The in-between region where curve 1 is above curve 2
- The in-between region where curve 1 is below curve 2
- The in-between region regardless of which curve is on top.
several shaded areas between temporal series
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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:
- The code represents just a shaded area (in this case I have two areas.)
- I have two lines, representing the max and min average. They are not represented by my code.
Thanks,
![shadedarea.png](https://www.mathworks.com/matlabcentral/answers/uploaded_files/143279/shadedarea.png)
1 commentaire
Image Analyst
le 19 Déc 2018
Modifié(e) : Image Analyst
le 19 Déc 2018
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
Please tell us what numbers, from the list above, you want shaded, and which color should go with which numbered region.
Réponses (1)
Mireia Fontanet
le 20 Déc 2018
1 commentaire
Yingjun Zhang
le 19 Jan 2020
Try below
fill([x.',fliplr(x.')], [min1.',fliplr(max1.')], 'r')
hold on
fill([x.',fliplr(x.')], [min2.',fliplr(max2.')], 'g')
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!