Making postscript files of the plots

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Making postscript files of the plots

Johan Jacobs
Hello,

How can I make postscript files of the plots I make in Octave?
I thought the command:
"gset terminal postscript"
would be enough, but it is not.
This command only puts the postscript-file to my terminal.
How can I 'catch' this output into a file.
The command
"plot(x,y) > file.ps"
gives no satisfation.

Johan Jacobs



Reply | Threaded
Open this post in threaded view
|

Re: Making postscript files of the plots

Mario Storti-4

> Hello,
>
> How can I make postscript files of the plots I make in Octave?
> I thought the command:
> "gset terminal postscript"
> would be enough, but it is not.
> This command only puts the postscript-file to my terminal.
> How can I 'catch' this output into a file.
> The command
> "plot(x,y) > file.ps"
> gives no satisfation.
>
> Johan Jacobs

I find handy this script "print.m". If you give an argument like in

> print("myfigure")

then it  writes to file "myfigure.ps". With  no argument  it prints to
the printer  (assume is "|lpr"). Afterwards  it resets the terminal to
X11.

Cheers,

Mario

%%%%%%<>%%%%%%<>%%%%%%<>%%%%%%<>%%%%%%<>%%%%%%<>%%%%%%<>%%%%%%<>%%%%%%<>%
Mario Alberto Storti                           | Fax: (54)(42) 55.09.44 |
Grupo de Tecnologia Mecanica                   | Tel: (54)(42) 55.91.75 |
INTEC, Guemes 3450 - 3000 Santa Fe, Argentina                           |
Reply: [hidden email], http://venus.unl.edu.ar/gtm-eng.html |


================================================================
function print(file);
%         PRINT("filename")
%                sends a copy of the current plot to a PostScript file
%         just PRINT sends a copy of the current plot to the printer

%$Id: print.m,v 1.3 1997/02/08 09:50:30 mstorti Exp mstorti $

gset term postscript
if nargin==1
    eval(["gset output \"" file ".ps\""])
    disp(["sending to file " file])
else
    gset output "|lpr"
    disp("sending to printer");
endif
replot
gset output
gset term X


Reply | Threaded
Open this post in threaded view
|

Re:Making postscript files of the plots

Craig Earls-2
In reply to this post by Johan Jacobs
Johan Jacobs writes:

>>Hello,
>>
>>How can I make postscript files of the plots I make in Octave?
>>I thought the command:
>>"gset terminal postscript"
>>would be enough, but it is not.
>>This command only puts the postscript-file to my terminal.
>>How can I 'catch' this output into a file.
>>The command
>>"plot(x,y) > file.ps"
>>gives no satisfation.

gset output filename.ps
gset terminal postscript
replot

--
-----------------------------------------------------------------
Craig P Earls                                 [hidden email]
LT US Navy, MIT Ocean Engineering             [hidden email]
-----------------------------------------------------------------