function h = plotmabcoast(option,varargin) % Plot MAB Coastline (Mid-Atlantic Bight) % han = pmc(options...) % option = a colorspec to specify coastline color % option = 'fill' fills land % additional options give color of land then coast % % Data are nominally 1:250000 World Vector Coastline from NGDC % coastline extractor web site. The vector file was modified to % allow filling using routine fillseg % John Wilkin jwilkin@rutgers.edu % % Example usage: % pmc('fill') grey land (default), black coast (default) % pmc('fill','r') red land, black coast(default) % pmc('fill','r','b') red land, blue coast % pmc('fill',[r g b],[r g b]) % pmc black coast default (no land fill) % pmc('r') red coast (no land fill) % get plot state nextplotstatewas = get(gca,'nextplot'); % hold whatever is already plotted set(gca,'nextplot','add') if exist('mab_coast.mat')~=2 error('The coastline data file mab_coast.mat is not in the path') else load mab_coast end if nargin == 0 option = 'fill'; end if isstr(option) if strcmp(option,'fill') land = 0.8*[1 1 1]; edge = [0 0 0]; if length(varargin)> 0 land = varargin{1}; end if length(varargin)> 1 edge = varargin{2}; end han = fillseg(c,land,edge); else % option is a colorspec vector for the coast color edge = option; land = 0; end else edge = option; land = 0; end if ~land han = plot(lon,lat,'-'); set(han,'color',edge) end % restore nextplotstate to what it was set(gca,'nextplot',nextplotstatewas); if nargout > 0 h = han; end