How to mask a data using the contour closed line?
21 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I have a lower resolution data. If I do masking using shapefile some portion around the boundary is getting cut. I just want to mention I don't want to interpolate.
Therefore, I am looking a for a solution where I can mask the data using contour lines itself. Regardless of whether a whole/half pixel coming inside of it. I want to show even a small portion of the pixel coming inside of it. I also don't want to show anything outisde the contour line.
I hope you could understand what I am looking for. You can see a figure attached below. You could see a Indian boundary contour, I just want to make outside that region white insider the rectangle box. Other things (colorbar,xticks,yticks) I want to keep at it's.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1060450/image.png)
Looking forward to your suggestion.
Thanks in advance.
0 Kommentare
Antworten (1)
KSSV
am 10 Jul. 2022
Read about inpolygon. Using this you can get the indices lying inside and outside the closed shape. Using tese indices you can make the puter points NaN and the plot.
3 Kommentare
Image Analyst
am 10 Jul. 2022
Tell us exactly what functions and arguments you used to display the image and the black outline.
Siehe auch
Kategorien
Mehr zu Contour Plots finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!