How do I mask out the ocean in m_map?

12 views (last 30 days)
Thomas Vaughan
Thomas Vaughan on 11 Oct 2016
Commented: Hitachi on 24 Aug 2020
I am plotting data that is over both land and ocean using m_map, but I only want the data over land to show up. Is there a way I can mask out the ocean (maybe by color filling everything outside of m_coastline instead of inside m_coastline)? I know there has to be a way to do this but I cannot figure it out. I've even tried using m_shaperead and using a shapefile of the ocean but couldn't get it that way either.

Answers (1)

KSSV
KSSV on 12 Oct 2016
  4 Comments
Image Analyst
Image Analyst on 15 Aug 2020
The Mathworks shutdown their newsreader. Try Google or Google Groups.
Hitachi
Hitachi on 24 Aug 2020
The way i did is
Download the land-ocean-mask martix, lile land.nc from NCEPRI.
Then set land grid = 1 and ocean grid = NaN.
Finally, multiply the matrix to the data.

Sign in to comment.

Categories

Find more on Oceanography and Hydrology in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!