> Dick, could you please repeat your posting about using ghostscript as viewer
> in gnuplot? I tried once or twice but I was never satisfied.
I'm not quite sure which posting you're refering to (I do post to the
newsgroup occasionally...), so I'll just tell what I know about using gnuplot
and ghostscript together, and hope that covers what you want to know.
I can think of three ways to use ghostscript to view a PostScript plot
generated by gnuplot. (I have left out the 'set terminal postscript'
command in the examples.)
1) through 'set output'
I believe it is possible to pipe the output directly to ghostscript
by using something like
set output "| ghostscript"
but I have never tried this. I almost always want a hardcopy of my
plots, so I always write the plot to a file.
2) execute a shell command from within gnuplot
This works pretty well, except you have to be sure that the output file
is closed before you view it.
set output 'plot.ps'
plot x
set output
!ghostscript plot.ps
set output 'anotherplot.ps'
plot sin(x)
set output
!ghostscript anotherplot.ps
This is fine if you are generating a single plot, but if you are trying
to write several plots into the same file it doesn't work well at all,
since you have to specify all everything for the plots each time (but that
could be partially fixed by 'save'ing each plot once it is finished and
'load'ing it in each time it is needed).
3) separate windows
This is my prefered mode of operation. In one window you run your editor.
Most editors let you write out a file without closing the session, so you
just stay in it until you're happy with the outcome. In the second window
you alternate between batch gnuplot and ghostscript. For example, if your
command file is 'commands.gp', then a transcript might be
(editing session in the first window)
set output 'plot.ps'
set title "Exampel"
plot x
(write out the file; toggle to the second window)
gnuplot commands.gp
ghostscript plot.ps
(toggle back to the first window to correct the typo)
set title "Example"
replot
(write out the file; toggle to the second window)
gnuplot commands.gp
ghostscript plot.ps
and so forth.
For me a great advantage of this is that, once you are done, you have a
record of exactly what created your plot -- and if you have put several
plots in a single file or made something fancy with 'multiplot', everything
is there, not just the last plot (which is what you'd get in the 'save'
file).
Dick Crawford, aka rccra...@lanl.gov
In message-Id: <1997022708...@les01.supelec.fr>
Juergen von Hagen <vonh...@les01.supelec.fr> wrote:
> Dick, could you please repeat your posting about using ghostscript as viewer
> in gnuplot? I tried once or twice but I was never satisfied.
I'm not quite sure which posting you're refering to (I do post to the
newsgroup occasionally...), so I'll just tell what I know about using gnuplot
and ghostscript together, and hope that covers what you want to know.
I can think of three ways to use ghostscript to view a PostScript plot
generated by gnuplot. (I have left out the 'set terminal postscript'
command in the examples.)
1) through 'set output'
I believe it is possible to pipe the output directly to ghostscript
by using something like
set output "| ghostscript"
but I have never tried this. I almost always want a hardcopy of my
plots, so I always write the plot to a file.
At least "newer" (>=3.something) ghostview versions together with
gnuplot 3.6betas don't work this way, they clear the page before you
can see the plot. I have put an awk-script (gsplot.awk) into
/f...@cmpc1.phys.soton.ac.uk:/incoming which works around this problem.
Jens
> I can think of three ways to use ghostscript to view a PostScript plot
> generated by gnuplot. (I have left out the 'set terminal postscript'
> command in the examples.)
> 1) through 'set output'
> I believe it is possible to pipe the output directly to ghostscript
> by using something like
> set output "| ghostscript"
> but I have never tried this. I almost always want a hardcopy of my
> plots, so I always write the plot to a file.
I use set out '|gs -q -' on unix
-q means run quietly, and - means use stdin non-interactively.
dd
--
david....@isltd.insignia.com
Tel +44 (0)1494 453376 (work) +44 (0)1494 459742 (home)