Documentation of draw_landmap


Global Index (all files) (short | long) | Local Index (files in subdir) (short | long)


Function Synopsis

hh = drawmapm(colr, lev)

Help text


  drawmapm(colr, lev);

  This function draws a map on the current map axis. 
  It gets the current frame and plots a map within
  the limits of the current map axis.

Cross-Reference Information

This function calls This function is called by

Listing of function draw_landmap

function hh = drawmapm(colr, lev)

next_ax = get(gca, 'NextPlot');
set(gca, 'NextPlot', 'add');

if ~ismap(gca);
  error('The current axes is not a map');
end

if (nargin<1); colr = 0*[1 1 1]; end;
if (nargin<2); lev = 1; end;

global FRAME
load coast;  x_coasts = long'; y_coasts = lat';

ylim = getm(gca, 'maplatlimit');
xlim = getm(gca, 'maplonlimit');

if ~isempty(find(xlim > 180));
  xlim(find(xlim > 180)) = xlim(find(xlim > 180)) - 360;
  keep = find(((x_coasts >= xlim(1)) | (x_coasts <= xlim(2))) & ...
            ((y_coasts >= ylim(1)) & (y_coasts <= ylim(2))));
else
  keep = find(((x_coasts >= xlim(1)) & (x_coasts <= xlim(2))) & ...
            ((y_coasts >= ylim(1)) & (y_coasts <= ylim(2))));
end

xcnew = NaN*ones(size(x_coasts));
ycnew = NaN*ones(size(y_coasts));

xcnew(keep) = x_coasts(keep);
ycnew(keep) = y_coasts(keep);
zcnew = ycnew;
zcnew(~isnan(zcnew)) = lev*1;

[b] = plot3m(ycnew,xcnew,zcnew,'-k');
set(b,'linewidth',0.5, 'color', colr);

set(gca, 'NextPlot', next_ax);

if nargout
    hh = b;
end