MATLAB Fill the area between the two contour plots

I have two contour graphs, and I want to be able to fill one contour with one image on the same height contour in another.

enter image description here

On the graph, you can see two lines of each color - these are the lines that I want to fill in, with the same color as the lines (although preferably translucent). The code for them is as follows

test = repmat(repelem(0:6,2),10,1); test1 = test(:,2:end-1); test2 = test(:,1:end-2); contour(test1,1:5); hold on; contour(test2,1:5); 

I thought that maybe I could create another image with the correct height in each drawer and do something like contourf , but this can be a problem if the lines intersect in the future, which they can do. In this case, I would like the area that they intersect to be a combination of the colors that intersect.

+4
source share

Source: https://habr.com/ru/post/1268858/


All Articles