help-octave
[Top][All Lists]
Advanced

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

Re: cannot plot via gnuplot (4.2.6) from octave 3.2.3 (on Mac OS 10.6)


From: Bob Q
Subject: Re: cannot plot via gnuplot (4.2.6) from octave 3.2.3 (on Mac OS 10.6)
Date: Wed, 14 Oct 2009 15:22:02 +0100

Thanks Tatsuro, Ben, Thomas,

with your advise, I have solved it, though noticed a curious pattern...

As soon as I open octave, if I do a...

> gnuplot_binary("/Applications/Gnuplot.app/Contents/Resources/bin/gnuplot")

...then gnuplot will work.

If I try plotting before doing such a thing the plot will fail in the way I stated originally, and if I do this gnuplot_binary(...) after plotting then I get the error and broken pipe warning.

The only way for it to work is if I do the gnuplot_binary before doing even one plot command.  Maybe some internal state changes in octave after doing the first plot and its failure that makes the gnuplot_binary become useless thereafter.


Before doing a gnuplot_binary("/Applications/Gnuplot.app/Contents/Resources/bin/gnuplot") ...

> gnuplot_binary
ans = gnuplot

> system ('which gnuplot')
ans =  1

...and attempting to run the command "gnuplot" from a bash terminal also cannot find it.


I don't actually have a ~/.octaverc.  Can I just make one a put the above gnuplot_binary(...) command in straight?


thanks for all your other hints and tips.
 - el Bobbo


On Wed, Oct 14, 2009 at 8:22 AM, Thomas Treichl <address@hidden> wrote:
Ben Abbott schrieb:

On Oct 13, 2009, at 12:19 PM, Bob Q wrote:

Hello,

I downloaded and installed the octave-3.2.3 dmg on Mac OS X (10.6,  intel) along with the gnuplot-4.2.6 dmg in the Extras.

At first, it could not find gnuplot...

plot(x,y)
[quote]
error: popen2 (child): unable to start process -- No such file or  directory
error: called from:
error:   /Applications/Octave 3.2.3.app/Contents/Resources/share/ octave/3.2.3/m/plot/__gnuplot_open_stream__.m at line 28, column 44
error:   /Applications/Octave 3.2.3.app/Contents/Resources/share/ octave/3.2.3/m/plot/gnuplot_drawnow.m at line 85, column 19
sh: gnuplot: command not found
error: you must have gnuplot installed to display graphics; if you  have gnuplot installed in a non-standard location, see the  'gnuplot_binary' function
octave-3.2.3:4> gnuplot_binary("/Applications/Gnuplot")
octave-3.2.3:5> plot(x,y)
sh: /Applications/Gnuplot: No such file or directory
error: you must have gnuplot installed to display graphics; if you  have gnuplot installed in a non-standard location, see the  'gnuplot_binary' function
[/quote]

...solving this with a...

gnuplot_binary("/Applications/Gnuplot.app/Contents/Resources/bin/
gnuplot")

...and again plotting gives...
[quote]
error: `unset' undefined near line 4 column 1
warning: broken pipe -- some output may be lost
[/quote]

where it can only be escaped with a ctrl-c.

Is gnuplot 4.2.6 not working with octave 3.2.3?  Is there a way  around this?

Your help or advise is greatly appreciated.

Thanks, Bob

Bob,

I've had no trouble with gnuplot 4.2.3 or later versions. I'm  currently running gnuplot's developer's sources.

Please try running gnuplot directly and type "set term". You'll see a  list of available terminals. For example, I get the list below ....

gnuplot> set term

Available terminal types:
             aqua  Interface to graphics terminal server for Mac OS X
///SNIP///
              x11  X11 Window System
///SNIP///

Please verify your gnuplot supports "aqua" and "x11".

If "aqua" is not present, then you can use the "x11" terminal by  adding the following to your ~/.octaverc file

       setenv ("GNUTERM", "x11")

If both aqua and x11 are listed, be sure to type "close all" before  you use "gnuplot_binary" to set the path to your gnuplot. If you set  gnuplot_binary in your ~/.octaverc, be sure to quit and restart octave  before attempting a plot.

Ben

Hi Bob, hi Ben,

I expect it has nothing to do with the terminal here. I do more expect it has to do with the "gnuplot_binary" or an environment variable. Bob, if you have installed Octave.app and Gnuplot.app both in the same directory then you normally need to set nothing, ie. don't need to set gnuplot_binary because it already is set to 'gnuplot' - Octave.app then automatically finds Gnuplot.app.

Please start up Octave and do nothing else but just calling

 gnuplot_binary

Next please call the command in Octave.app

 system ('which gnuplot')

Can you reply the output please.

 Thomas


reply via email to

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