Global Index (all files) (short | long) | Local Index (files in subdir) (short | long)
hh = drawcoasts ( lcst, lgrd, lbox, gridx, gridy ) ;
function hh = drawcoasts ( lcst, lgrd, lbox, gridx, gridy ) ; script to overlay a rectangular coastline map on the graphics window. INPUT ARGUMENTS: lcst : linetype for coastlines (default is COASTTYPE,' ' = default) lgrd : linetype for gridlines (default is COASTGRID, ' ' = default) lbox : linetype for frame box (default: '-k', '' or 0 to skip) gridx : grid_spacing in x direction (default is GRDX_SPACING) gridy : grid_spacing in y direction (default is GRDY_SPACING) GLOBAL SETTINGS (most of which can be overridden by call arguments) FRAME : plotting boundaries (see also frame) COASTWIDTH : Coastline width COASTTYPE : coastline type, set to 0 or '' for no coast COASTGRID : grid line stype, set to 0 or '' for no gridline GRDX_SPACING: longitudinal grid spacing GRDY_SPACING: latitudinal grid spacing SEE ALSO : frame, polar_coasts
| This function calls | |
|---|---|
function hh = drawcoasts ( lcst, lgrd, lbox, gridx, gridy ) ;
%---------------------------------------------- Alexis Lau (May 1991)
% major modification for version 4.X Alexis Lau (July 1993)
% rewritten Alexis Lau (Feb 1994)
%
% Added "sort" to the yticks definition in the grid lines specification.
% MATLAB 5 needs the ticks to increase monotonically.
% Todd Mitchell, July 1997
%
% Same is true for the xticks, added sort(xtickts)
% Christian Bantzer, 10/3/97
global FRAME COASTWIDTH COASTTYPE COASTGRID GRDX_SPACING GRDY_SPACING
global USE_LANDMASK
global x_coasts y_coasts
% if USE_LANDMASK;
% landmask;
% return;
% end
% set parameters
if nargin < 1; lcst = ' '; end;
if nargin < 2; lgrd = ' '; end;
if nargin < 3; lbox = ' '; end
if nargin < 4; gridx = GRDX_SPACING; end
if nargin < 5; gridy = GRDY_SPACING; end
if strcmp(lcst,' '); lcst='-k'; end
if strcmp(lgrd,' '); lgrd=':k'; end
if strcmp(lbox,' '); lbox='-k'; end
%-------------------------------------------------------------------
% make sure plotting in the preset frame
% frame;
% map is superimposed, will not affect existing display
push_hold;
% frame box
% xl=get(gca,'xlim'); yl=get(gca,'ylim');
xl = FRAME(1:2); yl = FRAME(3:4);
x0=xl(1); x1=xl(2); y0=yl(1); y1=yl(2);
% if lbox; plotm([x0 x0 x1 x1 x0],[y0 y1 y1 y0 y0],lbox); end;
% grid lines
% if ~USE_LANDMASK
xticks = sort([ 0:-gridx:x0 gridx:gridx:x1 ]);
yticks = sort( [ 0:-gridy:y0 gridy:gridy:y1 ] );
% manual_ticks('x',xticks, [' ']); %label_eastwest(xticks));
% manual_ticks('y',yticks, [' ']); %label_northsouth(yticks));
% end
if lgrd
for i = 1:length(xticks);
linem(yl,[xticks(i) xticks(i)], lgrd);
end
for i = 1:length(yticks);
linem(yticks(i)*ones(1,5),[xl(1):(diff(xl)/4):xl(2)], lgrd);
end
end
% vline(xticks,lgrd,yl); hline(yticks,lgrd,xl);
% end;