Home > bioelectromagnetism > save_epsc.m

save_epsc

PURPOSE ^

save_epsc - Save figure to EPS color file

SYNOPSIS ^

function save_epsc(file,F,res,color)

DESCRIPTION ^

 save_epsc - Save figure to EPS color file
 
 Usage: save_epsc(file,F,res,color)
 
 'file'    - the string filename
 'F'       - a figure handle, when empty uses 'gcf'
 'res'     - resolution (dpi, 600 default)
 'color'   - 0 = RGB, 1 = CMYK (default)

 This function uses the -painters option to render the output into a
 vector graphics format.  This may loose lighting/transparency effects in
 complex surfaces.

 Outputs Encapsulated Level 2 Color PostScript

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function save_epsc(file,F,res,color)
0002 
0003 % save_epsc - Save figure to EPS color file
0004 %
0005 % Usage: save_epsc(file,F,res,color)
0006 %
0007 % 'file'    - the string filename
0008 % 'F'       - a figure handle, when empty uses 'gcf'
0009 % 'res'     - resolution (dpi, 600 default)
0010 % 'color'   - 0 = RGB, 1 = CMYK (default)
0011 %
0012 % This function uses the -painters option to render the output into a
0013 % vector graphics format.  This may loose lighting/transparency effects in
0014 % complex surfaces.
0015 %
0016 % Outputs Encapsulated Level 2 Color PostScript
0017 %
0018 
0019 % $Revision: 1.1 $ $Date: 2004/11/12 01:32:35 $
0020 
0021 % Licence:  GNU GPL, no implied or express warranties
0022 % History:  10/2004, Darren.Weber_at_radiology.ucsf.edu
0023 %
0024 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0025 
0026 if exist('F','var'),
0027     if isempty(F), F = gcf; end
0028 else
0029     F = gcf;
0030 end
0031 
0032 if exist('file','var'),
0033     if isempty(file), error('no filename'); end
0034 else
0035     error('no filename');
0036 end
0037 
0038 if exist('res','var'),
0039     if isempty(res), res = 600; end
0040 else
0041     res = 600;
0042 end
0043 
0044 if exist('color','var'),
0045     if isempty(color), color = 1; end
0046 else
0047     color = 1;
0048 end
0049 
0050 fprintf('saving to:...%s\n',file);
0051 
0052 driver = '-depsc2';
0053 option1 = '-tiff';
0054 option2 = '-noui';
0055 option3 = '-painters'; % vector rendering, may loose lighting/transparency
0056 option4 = sprintf('-r%d',res);
0057 
0058 if color,
0059     print(F,driver,option1,option2,option3,option4,'-cmyk',file);
0060 else
0061     print(F,driver,option1,option2,option3,option4,file);
0062 end
0063 
0064 return

Generated on Mon 15-Aug-2005 15:36:19 by m2html © 2003