Home > atmlab > geoplots > gmt > makecpt.m

makecpt

PURPOSE ^

MAKECPT appends options to GMT makecpt

SYNOPSIS ^

function file = makecpt(in)

DESCRIPTION ^

 MAKECPT appends options to GMT makecpt

 PURPOSE: Appends options to a short script and calls the GMT

 IN      struct           options here (see help gmt_plot)

 NOTE    list of colortables found at /usr/lib/gmt/share/cpt/

 Created by Salomon Eliasson
 $Id: makecpt.m 7954 2012-10-28 20:57:41Z seliasson $

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

DOWNLOAD ^

makecpt.m

SOURCE CODE ^

0001 function file = makecpt(in)
0002 % MAKECPT appends options to GMT makecpt
0003 %
0004 % PURPOSE: Appends options to a short script and calls the GMT
0005 %
0006 % IN      struct           options here (see help gmt_plot)
0007 %
0008 % NOTE    list of colortables found at /usr/lib/gmt/share/cpt/
0009 %
0010 % Created by Salomon Eliasson
0011 % $Id: makecpt.m 7954 2012-10-28 20:57:41Z seliasson $
0012 
0013 mkcpt = sprintf('makecpt -C%s',in.ctable);
0014 
0015 if isfield(in,'tickval')
0016     mkcpt = sprintf('%s -Ttickvalues.txt',mkcpt);
0017 else
0018     mi = in.datarange(1);
0019     mx = in.datarange(2);
0020     step = in.stepsize;
0021     fstr = sprintf('%s -T%s/%s/%s',mkcpt,...
0022         getAnnotFormat(mi),getAnnotFormat(mx),getAnnotFormat(step));
0023     mkcpt = sprintf(fstr,mi,mx,step);
0024 end
0025 
0026 mkcpt = sprintf('%s --COLOR_NAN=%s',mkcpt,in.color_nan);
0027 mkcpt = sprintf('%s --COLOR_BACKGROUND=%s',mkcpt,in.color_background);
0028 mkcpt = sprintf('%s --COLOR_FOREGROUND=%s',mkcpt,in.color_foreground);
0029 
0030 file = 'ctable.cpt';
0031 command = [mkcpt ' > ' file];
0032 
0033 exec_system_cmd(command,gmtlab('verbosity'));

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