Home > atmlab > geoplots > gmt > grdcontour.m

grdcontour

PURPOSE ^

GRDCONTOUR appends options to GMT grdcontour

SYNOPSIS ^

function command = grdcontour(file,in)

DESCRIPTION ^

 GRDCONTOUR appends options to GMT grdcontour

 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: grdcontour.m 8362 2013-04-20 18:30:35Z seliasson $

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

DOWNLOAD ^

grdcontour.m

SOURCE CODE ^

0001 function command = grdcontour(file,in)
0002 % GRDCONTOUR appends options to GMT grdcontour
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: grdcontour.m 8362 2013-04-20 18:30:35Z seliasson $
0013 
0014 %location of file, region and projection
0015 grdcontour = sprintf('grdcontour %s -R -J',in.grdfile);
0016 
0017 grdcontour = sprintf('%s %s',grdcontour,in.plotPlacement);
0018 
0019 if isfield(in,'spacing')
0020     grdcontour = sprintf('%s -A%g',grdcontour,in.spacing);
0021 end
0022 
0023 if isfield(in,'fontsize')
0024     grdcontour = sprintf('%s+s%g',grdcontour,num2str(in.fontsize));
0025 end
0026 
0027 if isfield(in,'range')
0028     grdcontour = sprintf('%s -L%g-%g',grdcontour,in.range(1),in.range(2));
0029 end
0030 
0031 if isfield(in,'label_placement')
0032     grdcontour = sprintf('%s -G%s',grdcontour,in.label_placement);
0033 else
0034     % 4 inches apart, no closer than .5cm from each other in xy plane
0035     grdcontour = sprintf('%s -Gd4i+r.5c',grdcontour); 
0036 end
0037 
0038 if isfield(in,'more') && ~isempty(in.more)
0039     grdcontour = sprintf('%s %s',grdcontour,in.more);
0040 end
0041 
0042 % selects Overlay plot mode and assuming more pscode will be appended
0043 grdcontour = sprintf('%s -O -K',grdcontour);
0044 
0045 command = sprintf('%s >> %s.ps',grdcontour,file);

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