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: emooshag
Subject: Re: Different plot behavior in octave and gnuplot
Date: Wed, 12 Sep 2012 12:52:36 -0700 (PDT)

Laurent Hoeltgen wrote
> 
> 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
>> Help-octave@
>> 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
> 

Hi, Thank you for the quick reply. However, I don't believe the crux of my
issue is in syntax differences at this point, though I have much to learn.
Starting with the simplest plots given in the manual itself, I get expected
output for hist(y), bar(y), and stairs(y), but plot(y) does not produce a
horizontal line at y. I'm quite sure that plot(5), for example, should
produce a horizontal line at y = 5, without additional syntax.   Yet, even
when I set y = 5, and then try plot (y), I get a blank figure.  My question
is, why doesn't this plot?

Thank you,
Eric



--
View this message in context: 
http://octave.1599824.n4.nabble.com/Different-plot-behavior-in-octave-and-gnuplot-tp4644032p4644037.html
Sent from the Octave - General mailing list archive at Nabble.com.


reply via email to

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