help-octave
[Top][All Lists]
Advanced

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

Re: Different plot behavior in octave and gnuplot


From: Laurent Hoeltgen
Subject: Re: Different plot behavior in octave and gnuplot
Date: Wed, 12 Sep 2012 20:32:01 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:15.0) Gecko/20120827 Thunderbird/15.0

On 12/09/12 18:49, emooshag wrote:
Hello All,
I just installed octave on my Mac (OS 10.6.8) using Homebrew. I'm trying to
use the gnuplot from octave but getting different behavior than from gnuplot
itself.

 From gnuplot, plot sin(x) gives a red sine wave, as expected, but from
octave, the same command gives an empty figure.  Likewise, in gnuplot, "plot
(5)", for example, gives a red horizontal line at y = 5, as expected, but
from octave it gives an empty figure.  However, if I do something like:

octave> x = 1:100;
octave> plot (x)

The I get a visible blue diagonal line.

Possibly useful info:
gnuplot is set to x11 term type.

octave: system ("which gnuplot")
/usr/local/bin/gnuplot
ans = 0

terminal:~$ which gnuplot
/usr/local/bin/gnuplot

gnuplot> show loadpath
loadpath is empty
        gnuplotrc is read from /usr/local/Cellar/gnuplot/4.6.0/share/gnuplot/4.6
        no XAPPLRESDIR found in the environment,
            falling back to "/etc/X11/app-defaults/"


I assume that octave is not getting the some default parameters (line
colors, weights, etc.) that are being used when i'm in gnuplot but cannot
figure out how to get octave to use them too. I realize I can probably
change the octave behavior setting parameters .octaverc, but it seems like
that shouldn't be necessary. How do I point to the gnuplot settings?

Any help is appreciated.

Thanks,
Eric





--
View this message in context: 
http://octave.1599824.n4.nabble.com/Different-plot-behavior-in-octave-and-gnuplot-tp4644032.html
Sent from the Octave - General mailing list archive at Nabble.com.
_______________________________________________
Help-octave mailing list
address@hidden
https://mailman.cae.wisc.edu/listinfo/help-octave


Hi,

octave and gnuplot are two different programs that use different syntaxes. The equivalent for gnuplot's sin(x) in octave would for example be something like:

plot(linspace(0,2*pi,100),sin(linspace(0,2*pi,100));

I suggest you read the octave manual about plotting. It contains a lot of explanations on how to achieve various formattings of the plots in octave.

Regards,
Laurent


reply via email to

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