[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: saving in postscript format
From: |
Daniel Heiserer |
Subject: |
Re: saving in postscript format |
Date: |
Mon, 03 May 1999 17:23:53 +0200 |
Gerald Marewo (unix) wrote:
>
> What is the Octave equivalent to Matlab's "print" command for saving a
> graph to file?
It is not part of the distribution AFAIK.
I attached what was posted in the newsgroupt some time ago.
It works.
>
> Gerald Marewo
>> cat print.m
## usage: PRINT("filename",terminal):
## * sends a copy of the current plot to a PostScript file
## * if filename is missing, pipe to "| lpr"
function print(file,terminal);
## $Id: print.m,v 1.3 1997/02/08 09:50:30 mstorti Exp mstorti $
if nargin==0
file="|lpr";
else
eval(['gset output "',file,'"']);
endif
# bugfix
if nargin < 2
gset term postscript color
replot
gset term X
replot
else
if terminal=='ps_'
gset term postscript color
replot
gset term X
replot
elseif terminal=='eps'
gset term postscript eps color
replot
gset term X
replot
elseif terminal=='pbm'
gset term pbm color
replot
gset term X
replot
end
end
endfunction
--
Mit freundlichen Gruessen
Daniel Heiserer
-----
--------------------------------------------------------------
Dipl.-Phys. Daniel Heiserer, BMW AG, Knorrstrasse 147, 80788 Muenchen
Abteilung EK-20
Tel.: 089-382-21187, Fax.: 089-382-42820
mailto:address@hidden