Global Index (all files) (short | long) | Local Index (files in subdir) (short | long)
hh = fill_oceanmap(lev, colr);
hh = fill_oceanmap(lev, colr); Adds an ocean mask to the given plot, at the elevation specified by 'lev', and color 'colr'. As with fill_landmap, 'lev' may be 'over', 'under', 'o', 'u', or a scalar indicating the z-level that the map should be drawn at. 'colr' may be a color string, or a 3 element vector.
| This function calls | This function is called by |
|---|---|
function hh = fill_oceanmap(lev, colr);
load oceanlo;
numpatch = length(oceanmask);
if nargin < 2; colr = 0.7; end;
if nargin < 1; lev = 'over'; end;
if isstr(lev);
child = get(gca, 'Children');
plotlev = [0 0];
for i = 1:length(child);
zd = get(child(i), 'ZData');
plotlev(1) = max([plotlev(1); zd(:)]);
plotlev(2) = min([plotlev(2); zd(:)]);
end
if strcmp(lev(1), 'o');
lev = plotlev(1)+1;
elseif strcmp(lev(1), 'u');
lev = plotlev(2)-1;
else
error('lev must be over, under, or a scalar');
end
end
if ~isstr(colr);
if isscalar(colr); colr = colr*[1 1 1]; end;
end
global FRAME; tol = 5e5*epsm;
latlim = FRAME(3:4)+[-1 1]*tol;
hout = [];
for i = 1:numpatch;
lat = oceanmask(i).lat;
lon = oceanmask(i).long;
[lat2, lon2] = maptrimp2(lat, eastof(lon, FRAME(1)), latlim, FRAME(1:2));
if any(~isnan(lat2));
htem = patchm(lat2, lon2, lev, colr);
hout = [hout htem];
end
end
set(hout, 'edgecolor', 'none');
if nargout == 1;
hh = hout;
end