Home > atmlab > geoplots > gmt > xtra_nan_legend.m

xtra_nan_legend

PURPOSE ^

XTRA_NAN_LEGEND create an extra legend box for the missing values

SYNOPSIS ^

function file = xtra_nan_legend(in)

DESCRIPTION ^

 XTRA_NAN_LEGEND create an extra legend box for the missing values

 Purpose: To create an extra legend box for the missing values

 IN     struct:    in.outdir                where to put file
                   in.color_nan             The color of NAN
                
 OUT    %s         fileThe output-file location

 Created by Salomon Eliasson
 $Id: xtra_nan_legend.m 7221 2011-11-24 18:15:58Z seliasson $

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

DOWNLOAD ^

xtra_nan_legend.m

SOURCE CODE ^

0001 function file = xtra_nan_legend(in)
0002 % XTRA_NAN_LEGEND create an extra legend box for the missing values
0003 %
0004 % Purpose: To create an extra legend box for the missing values
0005 %
0006 % IN     struct:    in.outdir                where to put file
0007 %                   in.color_nan             The color of NAN
0008 %
0009 % OUT    %s         fileThe output-file location
0010 %
0011 % Created by Salomon Eliasson
0012 % $Id: xtra_nan_legend.m 7221 2011-11-24 18:15:58Z seliasson $
0013 
0014 %create nan.cpt for NaN colorbox
0015 file = 'color_nan.cpt'; %save to local file
0016 fid = fopen(file,'w');
0017 fprintf(fid,'%s\n','#cpt file created by: xtra_nan_legend.m');
0018 fprintf(fid,'%s\n','# Created for NaN colorbox');
0019 fprintf(fid,'%s\n%s\n','#COLOR_MODEL = RGB','#');
0020 
0021 if isfield(in,'color_nan')
0022     tmp = splitstring(in.color_nan,'/');
0023     str = sprintf('%s\t%s\t%s',tmp{1},tmp{2},tmp{3});
0024 else
0025     str = '128\t128\t128';
0026 end
0027 fprintf(fid,'%i\t%s\t%i\t%s\t%s\n',1,str,2,str,';NaN');
0028 fclose(fid);

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