Home > atmlab > geoplots > gmt > pspoly.m

pspoly

PURPOSE ^

PSPOLY Make polygons to plot with GMT

SYNOPSIS ^

function commands = pspoly(file,in,commands)

DESCRIPTION ^

 PSPOLY Make polygons to plot with GMT

 IN      file     %s       file to append to
         in       struct   options here (see help gmt_plot)
         command  cell     cell of string commands for systemcall

 OUT     command  cell     cell of string commands for systemcall

 Created by Oliver Lemke
 $Id: pspoly.m 7157 2011-09-18 10:38:57Z seliasson $

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

DOWNLOAD ^

pspoly.m

SOURCE CODE ^

0001 function commands = pspoly(file,in,commands)
0002 % PSPOLY Make polygons to plot with GMT
0003 %
0004 % IN      file     %s       file to append to
0005 %         in       struct   options here (see help gmt_plot)
0006 %         command  cell     cell of string commands for systemcall
0007 %
0008 % OUT     command  cell     cell of string commands for systemcall
0009 %
0010 % Created by Oliver Lemke
0011 % $Id: pspoly.m 7157 2011-09-18 10:38:57Z seliasson $
0012 
0013 colors = in.plot.pspoly.colors;
0014 thick = in.plot.pspoly.thick;
0015 pp = in.plot.pspoly.pspoly;
0016 
0017 for i = 1:size(pp,1)    
0018     %stdin
0019     %% get full coordinates
0020     ppcur = pp{i};
0021     a=cell(size(ppcur,1)+1,1);
0022     for j = 1:size(ppcur,1)
0023         a{j}=sprintf('%d %d',ppcur(j,1), ppcur(j,2));
0024     end
0025     a{size(ppcur,1)+1}=a{1};
0026     
0027     stdin = [a{1},' M\n'];
0028     for j = 2:size(ppcur,1)
0029         stdin = [stdin,a{j},' D\n'];
0030     end
0031     stdin = [stdin,a{size(ppcur,1)+1},' D'];
0032     
0033     command = sprintf('echo -e "%s" |',stdin);
0034     command = sprintf('%s psxy -R -J -A',command);
0035     command = sprintf('%s %s',command,in.plotPlacement);
0036     
0037     % color and size of box
0038     
0039     c = colors{i};
0040     s = thick{i};
0041     command = sprintf('%s -W%d/%d/%d/%d',command,s,c(1),c(2),c(3));
0042     commands{end+1} = sprintf('%s -K -O >> %s.ps',command,file);
0043 end

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