Thread Subject:
ocean mask

Subject: ocean mask

From: paul.stoy@montana.edu

Date: 31 Mar, 2010 22:30:15

Message: 1 of 3

Hi. The Mapping Toolbox examples show a nice way to mask out land
(below). How do I mask out the ocean instead?

Thanks.

load geoid
% Create a figure with an Eckert projection.
figure
axesm eckert4;
framem; gridm;
axis off

% Display the geoid as a texture map.
geoshow(geoid, geoidrefvec, 'DisplayType', 'texturemap');

% Create a colorbar and title.
hcb = colorbar('horiz');
set(get(hcb,'Xlabel'),'String','EGM96 Geoid Heights in Meters.')

% Mask out all the land.
geoshow('landareas.shp', 'FaceColor', 'black');

Subject: ocean mask

From: Rob Comer

Date: 2 Apr, 2010 02:20:24

Message: 2 of 3

You can mask out the world's land areas by reversing the direction of the vertices in a pair of global coastline latitude-longitude vectors like the ones in coast.mat (so that instead of having land on the right hand side of each curve and water on the left, it will be the other way around) -- like this:

>> load coast
>> geoshow(flipud(lat),flipud(long),'DisplayType','polygon','FaceColor','black')

Rob Comer
Mapping Toolbox Development
The MathWorks, Inc.

Subject: ocean mask

From: Ste

Date: 29 Feb, 2012 22:46:25

Message: 3 of 3

"Rob Comer" <rob.comer.nospam@mathworks.com> wrote in message <hp3k98$qbq$1@fred.mathworks.com>...
> You can mask out the world's land areas by reversing the direction of the vertices in a pair of global coastline latitude-longitude vectors like the ones in coast.mat (so that instead of having land on the right hand side of each curve and water on the left, it will be the other way around) -- like this:
>
> >> load coast
> >> geoshow(flipud(lat),flipud(long),'DisplayType','polygon','FaceColor','black')
>
> Rob Comer
> Mapping Toolbox Development
> The MathWorks, Inc.

That works perfect for me on the screen, but when I try to save (with saveas) or export (with the function export_fig, from: http://www.mathworks.com/matlabcentral/fileexchange/23629) the figure, the ocean areas are all visible again.. Do you have any tips on how to solve this probelm?

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
mapping Rob Comer 1 Apr, 2010 22:24:09
rssFeed for this Thread

Contact us