help-octave
[Top][All Lists]
Advanced

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

Re: what's wrong with the plot?


From: Miquel Cabanas
Subject: Re: what's wrong with the plot?
Date: Mon, 04 Apr 2005 15:28:03 +0200
User-agent: Mutt/1.3.28i

hi,

if you take a close look at the eps file you will notice that there
are actually *two* pages in it.

$ grep -n "page" anta*
379:showpage
535:showpage

The first page contains the plot the x vs y and its legend, and the
second one contains both plots and legends. Ghostview somehow only
shows you the 2nd and final page (*), I guess Lynx creates a preview
from the 2nd page too, and that when creating the final PS file it
displaces the 2nd page with respect to the 1st one.

(*) though my version shows two pages...

To avoid such problems, you should create a complete plot on screen
(i.e. with gset terminal x11, default on linux) and then switch the
terminal to postscript and do a replot, that way you will have every
thing plotted on a single page, e.g.

y=[97 89 67 62 50 41 35 25];
x=1:8;
koeff=polyfit(x,log(y),1);
realkoeff=exp(koeff)
yp=polyval(koeff,x);
plot(x,y,';verkligt antal;',x,exp(yp),';exponentiellt bortfall;');

gset terminal postscript eps
gset output 'antal2004.eps'
replot

gset terminal x11
replot

$ grep -n "page" anta*
399:showpage

Incidentally, note that the use of gset is kinda deprecated in favour
of higher level commands like print. Visit octave-forge for more info,

http://octave-forge.sf.net

Miquel


On Mon, Apr 04, 2005 at 12:26:42PM +0200, Gunnar wrote:
>
> I'm using octave in linux, and I have created a plot with these commands
> 
> y=[97 89 67 62 50 41 35 25];
> x=1:8;
> koeff=polyfit(x,log(y),1);
> realkoeff=exp(koeff)
> yp=polyval(koeff,x);
> gset terminal postscript eps
> gset output 'antal2004.eps'
> plot(x,y,';verkligt antal;',x,exp(yp),';exponentiellt bortfall;');




-- 
Miquel E Cabanas ------------------------------------------------------
SeRMN, Universitat Autonoma de Barcelona (address@hidden)
MRUI Software Manager (address@hidden)
------------------------------------------o-oo--ooo---ooo--oo-o--------



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

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

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