Home > atmlab > geoplots > gmt > pscoast.m

pscoast

PURPOSE ^

PSCOAST appends options to GMT pscoast

SYNOPSIS ^

function command = pscoast(file,in)

DESCRIPTION ^

 PSCOAST appends options to GMT pscoast

 PURPOSE:  Appends options to a short script and calls the GMT
 
 IN    file      %s              .ps-file created/appened to by command
       in        struct          options here (see help gmt_plot)

 OUT   command   %s              string command to be used in system call

 Created by Salomon Eliasson
 $Id: pscoast.m 8362 2013-04-20 18:30:35Z seliasson $

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

DOWNLOAD ^

pscoast.m

SOURCE CODE ^

0001 function command = pscoast(file,in)
0002 % PSCOAST appends options to GMT pscoast
0003 %
0004 % PURPOSE:  Appends options to a short script and calls the GMT
0005 %
0006 % IN    file      %s              .ps-file created/appened to by command
0007 %       in        struct          options here (see help gmt_plot)
0008 %
0009 % OUT   command   %s              string command to be used in system call
0010 %
0011 % Created by Salomon Eliasson
0012 % $Id: pscoast.m 8362 2013-04-20 18:30:35Z seliasson $
0013 
0014 pscoast = sprintf('pscoast -R -J');
0015 
0016 pscoast = sprintf('%s %s',pscoast,in.plotPlacement);
0017 
0018 % selects Overlay plot mode and assuming more pscode will be appended
0019 pscoast = sprintf('%s -O -K',pscoast);
0020 
0021 % set the minimal area of features to plot
0022 if isfield(in,'features')
0023     pscoast = sprintf('%s -A%g',pscoast,in.features);
0024 end
0025 
0026 if isfield(in,'resolution')
0027     pscoast = sprintf('%s -D%s',pscoast,in.resolution);
0028 end
0029 
0030 if isfield(in,'rivers')
0031     pscoast = sprintf('%s -I%s',pscoast,in.rivers);
0032     if isfield(in,'color') % for rivers
0033         pscoast = sprintf('%s/%s',pscoast,in.color);
0034     end
0035 end
0036 
0037 %Draw coastlines. Append attributes [Defaults: width = 1, color = black, texture = solid].
0038 if isfield(in,'width')
0039     pscoast = sprintf('%s -W%gp',pscoast,in.width);
0040 else pscoast = sprintf('%s -W',pscoast);
0041 end
0042 if isfield(in,'color') %for coast
0043     pscoast = sprintf('%s/%s',pscoast,in.color);
0044 end
0045 
0046 command = sprintf('%s >> %s.ps',pscoast,file);

Generated on Mon 15-Sep-2014 13:31:28 by m2html © 2005