Code covered by the BSD License  

Highlights from
publish2latex

image thumbnail

publish2latex

by

 

09 Apr 2013 (Updated )

Using full Latex markup in m-files to generate high quality documentation. Version 1.3

printFigure(H,FileName,Format,PrintOn)
function printFigure(H,FileName,Format,PrintOn)
%
% Description: Function to print a figure to disk
%
% Input Parameters:
%  H:        Handel to the figure which is to be plotted
%  FileName: File name to be used without extension
%  Format:   The type of file format to be used.
%                  jpg, bmp, wmf, eps, eps2, png
%  PrintOn:  Boolean to switch on or off printing.
%
% Return Paramerets:
%
%
% By: 		Paul O`Leary
% Date:		2. July 1999
% Version:	1.0
%
% (c) 1999, Instutite for Automation, University of Leoben, Leoben, Austria
% email: automation@unileoben.ac.at, url: automation.unileoben.ac.at
%
%
% History:
%	Date: 	Comment:
%	1.7.1999	Original Vereion 1.0
%
narg=nargin;
    figure(H);
if ((nargin==4)&(PrintOn==1))|(nargin==3)
    Format=lower(Format);
    switch Format,
        case {'jpg'}
            print('-djpeg','-opengl','-zbuffer',FileName);
        case {'wmf'}
            print('-dmeta',FileName);
        case {'eps'}
            %print('-depsc','-loose','-r300','-opengl',FileName);
            print('-depsc','-loose','-r300','-painter',FileName);
            %print('-depsc','-loose','-zbuffer',FileName);
            %print('-depsc','-r300',FileName);
        case {'eps2'}
            print('-depsc','-loose','-r300','-zbuffer',FileName);
        case {'eps3'}
            print('-depsc','-loose','-r300','-opengl',FileName);
        case {'tiff'}
            print('-dtiffn','-opengl','-r300','-zbuffer',FileName);
        case {'bmp'}
            print('-dbitmap','-opengl','-r300','-zbuffer',FileName);
        case {'png'}
            print('-opengl','-dpng','-loose','-zbuffer',FileName);
            %          print('-dpng',FileName);
        case {'pdf'}
            print('-opengl','-dpdf','-loose','-zbuffer',FileName);
            %          print('-dpng',FileName);
        otherwise
            disp('Incorrect file format requested');
    end;
end;
%
% End M file

Contact us