How to make contourf plots beyond a polygon invisible?
8 views (last 30 days)
Show older comments
I use the below to plot a contourf of a geographic region (imagine it is the Mediterranean Sea).
[X, Y] = meshgrid(linspace(min(lon),max(lon),100),linspace(min(lat),max(lat),100));
Z = griddata (lon, lat, variable, X, Y);
[C, h] = contourf (X, Y, Z, [1:0.1:4], 'LineStyle', 'none' );
The problem is that the contour extends beyond the sea into the land. How do I hide the contourf portions that extend beyond the boundary (polygon)? Thanks.
0 Comments
Accepted Answer
More Answers (0)
See Also
Categories
Find more on Contour Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!