[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: postscript octave plots display incorrectly?

From: John W. Eaton
Subject: Re: postscript octave plots display incorrectly?
Date: Mon, 29 Jul 2002 00:34:03 -0500

On 28-Jul-2002, Kent Lundberg <address@hidden> wrote:

| On Sun, 28 Jul 2002 00:15:43 -0600 (MDT)
| "Dmitri A. Sergatskov" <address@hidden> wrote:
| > > having trouble with postscript plots from octave displaying
| > > incorrectly. Here's the command:
| > > 
| > > semilogy(year(1:13),erbw(1:13),"*;;",x,10.^(p(1)*x+p(2)),"-;;")
| > > 
| > > Furthermore, if I translate the produced postscript file into pdf with
| > > epstopdf v2.7, the dashed line disappears! I'm trying to produce both
| > > postscript and PDF versions of my document using latex and pdflatex
| > > with the graphicx package, which is why I want both ps and pdf
| > > versions of my figures.  I can put demonstration files on my website,
| > > if that would help.
| > 
| > I cannot reproduce that -- dashed line in ps stays dashed in pdf.
| > I am using older epstopdf (2.5) which comes with RedHat 7.3
| > (tetex-1.0.7-47 rpm package).
| Upon closer examination, I may have found part of the problem:  For me,
| the above semilogy command causes gnuplot to create postscript file that
| has *two* "showpage" commands in it.  For some reason this confuses
| epstopdf, but it does not seem to bother dvips.
| If I manually edit the eps file, and remove the first showpage (but not
| the second), I no longer have the disappearing line problem with pdflatex.

I think the problem is that if you do

  gset term postscript
  gset output ""
  semilogy (x1, y1, x2, y2);

Octave will generate two pages of output.  The first page will
have the first line, and the second will have both lines.  The reason
for this is that Octave processes the sets of arguments by sending
commands like

  plot "tmp-file-with-x1-y1"
  replot "tmp-file-with-x2-y2"

to gnuplot, and gnuplot doesn't doesn't do exactly what you want in
this case.

A way around this is to do

  semilogy (x1, y1, x2, y2);
  gset term postscript
  gset output ""


It might help to rewrite Octave's plotting functions to save up all
the commands that need to be passed to gnuplot and then generate a
single plot command that draws all the lines instead of a plot command
followed by some number of replot commands to add lines.  But making
this work in a reasonable way when the user sets "hold on" might be a
bit more difficult.



Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:
How to fund new projects:
Subscription information:

reply via email to

[Prev in Thread] Current Thread [Next in Thread]