Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

multipage output for postscript ?

331 views
Skip to first unread message

Roger Zimmermann

unread,
Feb 29, 2000, 3:00:00 AM2/29/00
to
Hi,

is there a chance to store several pages into *one* postscript file ?
I have *two* X11 plots from gnuplot which I would like to keep in one
postscript file.

Cheers, Roger
--
Dr. Roger Zimmermann *** Institute of Physiology, Hamburg
Martinistra/3e 52 D-20246 Hamburg Tel.: <D>/40 42803 5351
-------------------------------- Fax.: <D>/40 42803 4920
R.Zimm...@Uke.Uni-Hamburg.de//r...@snafu.de
PGP-ID: Roger Zimmermann <zimme...@fvk-berlin.de>
KeyPrint=83 16 D1 82 06 71 16 60 6F 61 95 65 BB CA 02 E0

Hans-Bernhard Broeker

unread,
Feb 29, 2000, 3:00:00 AM2/29/00
to
Roger Zimmermann <R.Zimm...@uke.uni-hamburg.de> wrote:
> Hi,

> is there a chance to store several pages into *one* postscript file ?

No problem, usually. Just don't close the PostScript output before
you do the next plot, and it will go into the same file, as a new page.

set term postscript
set out 'twoplots.ps'
plot sin(x)
plot cos(x)
set out

This gives you a nice two-page PostScript file. It won't work with
encapsulated postscript ('eps'), as EPS files aren't allowed to
contain more than one page. But that wouldn't make sense, anyway,
would it?

The only thing that will not work is to put one plot into a .ps file,
switch back to X11 output, create another plot, and then plot that
into the same .ps file, too --- gnuplot deletes the file you 'set
output' to, so the first plot would be lost.
--
Hans-Bernhard Broeker (bro...@physik.rwth-aachen.de)
Even if all the snow were burnt, ashes would remain.

Roger Zimmermann

unread,
Mar 1, 2000, 3:00:00 AM3/1/00
to Hans-Bernhard Broeker
Hans-Bernhard Broeker wrote:

> No problem, usually. Just don't close the PostScript output before
> you do the next plot, and it will go into the same file, as a new page.

OK, but I've a set of replot commands that generate the first and than the
second page ...set term X11 1
plot ...
replot ...
set term X11 2
plot ....
replot ...

> The only thing that will not work is to put one plot into a .ps file,
> switch back to X11 output, create another plot, and then plot that
> into the same .ps file, too --- gnuplot deletes the file you 'set
> output' to, so the first plot would be lost.

I think that would be exact what I need. If I do the replots with term set
to postscript, every replotgenerates a new page :-(
Can I 1) plot & replot the data to two buffers and 2) plot both buffers to
a postscript file as two pages ?THNX, Roger

Hans-Bernhard Broeker

unread,
Mar 1, 2000, 3:00:00 AM3/1/00
to
Roger Zimmermann <R.Zimm...@uke.uni-hamburg.de> wrote:
> Hans-Bernhard Broeker wrote:

>> No problem, usually. Just don't close the PostScript output before
>> you do the next plot, and it will go into the same file, as a new page.

> OK, but I've a set of replot commands that generate the first and than the
> second page ...set term X11 1
> plot ...
> replot ...
> set term X11 2
> plot ....
> replot ...

For a canned series of commands, 'replot' is a waste of time and
effort. Use multiple graph specifiers in a single 'plot' command,
instead:

plot 'data1' u 1:2 with lines, \
'data2' u 3:8 with linespoints linetype 5, \
f(x) title 'theory'

I hope you get the picture. This will create exactly one page of
output, unlike your example above.

If all of the commands you show above are in a single file, you'll
have to edit it, to separate the terminal settings from the plot
commands.

> I think that would be exact what I need. If I do the replots with term set
> to postscript, every replotgenerates a new page :-(

Well, don't do that, then :-). See above. In fact, your X11 'replots' also
generated a new page, each. You just don't see it, so fast does it get
overplotted.

> Can I 1) plot & replot the data to two buffers and 2) plot both buffers to
> a postscript file as two pages ?THNX, Roger

There are no such 'buffers' in gnuplot.

0 new messages