0

I'm tiring to plot contour map like picture is following below , i can plot the contour, but problem is with shadow area on contour . actually i have 4 vector data [x,y,z,k]. x,y area coordinates and z , k are levels . my code:

sample=xlsread('sample.xlsx');
x=(sample(:,1));
y=(sample(:,2));
z=(sample(:,3));
k=sample(:,4);
N=50;
[X,Y]=meshgrid(linspace(min(x)-0.2, max(x)+0.2, N), linspace(min(y)-0.2, max(y)+0.2, N));

F = scatteredInterpolant(x, y, z);
FF=scatteredInterpolant(x, y, k);
Z= F(X,Y);
ZZ=FF(X,Y);

contour(X,Y,Z,'ShowText','on') %main contour
hold on
???? shadow???

How should do this ?? thanks enter image description here

enter image description here

amir1122
  • 57
  • 5
  • What kind of area do you want to shade? Are they defined by the isolines? Or are they defined else where? The shaded areas in the picture don't match the isolines. – Miscellaneous Nov 20 '21 at 02:43
  • I have another vector data (4th vector) for shaded areas – amir1122 Nov 20 '21 at 11:17
  • Do you mean you want to overlap two contour plot in the same graph, one is isolines only, and the other one is shaded at some threshold value (e.g. k > 0)? – Miscellaneous Nov 21 '21 at 02:29

1 Answers1

0

If you have the X-Y points of the "shadow area", you can use the fill command (documentation)

fill(X_Area,Y_Area,'b')
Marco Torres
  • 186
  • 6