How do I hide contour lines that overlap my map objects?

How do I hide contour lines that overlap my map objects?
When I display my data as contour plots on a map, some contour lines overlap with the map objects such as land and islands. How do I make them hide under the map objects? The following code shows this overlap:
load topo
axesm robinson; framem
[c,h]=contorm(topo,topolegend);
displaym(worldlo('POpatch'))

 채택된 답변

MathWorks Support Team
MathWorks Support Team 2009년 6월 27일
The reason the contour lines are not getting hidden is that the patches and the contour lines are on the same Z level (the value is 0 by default). In order to have the contours hidden under the patches, the contours must be at a lower Z level than the patches. You can use the ZDATAM function to accomplish this. The following code is an example of how this works:
%
load topo;
axesm robinson; framem;
[c,h]=contorm(topo,topolegend);
displaym(worldlo('POpatch'));
title('Contours Overlap');
figure;
axesm robinson; framem
[c,h]=contorm(topo,topolegend);
displaym(worldlo('POpatch'));
zdatam(handlem('allline'),-1)
title('Contours hidden behind map objects');

추가 답변 (0개)

제품

Community Treasure Hunt

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

Start Hunting!

Translated by