help-octave
[Top][All Lists]
Advanced

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

Re: octave snow leopard


From: Stuart Edwards
Subject: Re: octave snow leopard
Date: Wed, 4 Jan 2012 09:22:41 -0500

On Jan 3, 2012, at 9:46 PM, Ben Abbott wrote:

> On Jan 3, 2012, at 9:27 PM, yuejun yin wrote:
> 
>> On Dec 31, 2011, at 11:24 AM, Ben Abbott wrote:
>> 
>>> On Dec 31, 2011, at 7:47 AM, yuejun yin wrote:
>>> 
>>>> On Dec 30, 2011, at 4:44 PM, Ben Abbott wrote:
>>>> 
>>>>> On Dec 28, 2011, at 11:17 PM, yuejun yin wrote:
>>>>> 
>>>>>> hi,
>>>>>> 
>>>>>> I installed octave 3.4.0 on snow leopard. Then I run:
>>>>>> 
>>>>>>  x = 1;
>>>>>>  y = 1;
>>>>>>  plot(x,y)
>>>>>> 
>>>>>> no plot comes out. AquaTerm popped out but no image window. what 's 
>>>>>> wrong? thanks a lot. I followed the process in this link, except step 4 
>>>>>> (about environment variable).
>>>>>> 
>>>>>> http://www.island94.org/2007/09/setting-up-octave-and-gnuplot-on-osx/
>>>>>> 
>>>>>> two images on this case are attached.
>>>>> 
>>>>> My guess is that your gnuplot isnt' working correctly.
>>>>> 
>>>>> Try ...
>>>>> 
>>>>> (1) Open a terminal window and type "gnuplot"
>>>>> 
>>>>> (2) If gnuplot runs, then type "plot sin(x)"
>>>>> 
>>>>> Does that work?
>>>>> 
>>>>> Ben
>>>> 
>>>> Ok. Now. I installed gnuplot and tested sin(x). it works. However, the 
>>>> plot in octave still does not work. The aqua term is turned on by the plot 
>>>> command. but no image comes out.
>>> 
>>> Can you tell me where your gnuplot is ? and what you did to allow the 
>>> command "gnuplot" to work correctly from the Terminal.
>>> 
>>> Next, a few checks to make sure that Octave is recognizing the correct 
>>> gnuplot. From Octave's prompt type ...
>>> 
>>> getenv ("GNUTERM")
>>> ans = aqua
>> 
>> unfortunately,
>> octave did not give me a word on 
>> getenv("GNUTERM")
>> 
>>> gnuplot_binary 
>>> ans = gnuplot
>> 
>> octave gave the same answer.
>> 
>>> system "which gnuplot"
>>> /opt/local/bin/gnuplot
>> 
>> octave-3.4.0:5> system "which gnuplot"
>> /Applications/Gnuplot.app/Contents/Resources/bin/gnuplot
>> ans = 0
>> 
>>> __gnuplot_version__ 
>>> ans = 4.4.4
>> 
>> octave-3.4.0:6> __gnuplot_version__
>> ans = 4.4.3
>> 
>>> I'd be surprised if the first two don't give the same answers, but please 
>>> confirm.
>>> 
>>> "which gnuplot" will tell you were Octave thinks the gnuplot binary is 
>>> located and the last will tell you the version of gnuplot that Octave sees. 
>>> Please confirm these correspond to the same gnuplot which runs from the 
>>> Terminal.
>>> 
>>> Finally, it is possible something is wrong with how gnuplot is 
>>> communicating with Aquaterm, or something is wrong with your Aquaterm. Try 
>>> ...
>>> 
>>> setenv GNUTERM x11
>>> close all
>>> plot (0:10)
>>> 
>>> This will ask gnuplot to use X Windows for plotting. Does this open the X11 
>>> application and produce a plot ?
>> 
>> Yes. X11 is lunched and a figure is successfully plotted.
>> It seems octave does not know the gnuplot term.
>> 
>> Thanks for your help. where does the settings for the gnuplot in octave?
> 
> There seems to be some problem with your gnuplot using Aquaterm. Before 
> giving up on Aquaterm, try ...
> 
>       setenv GNUTERM aqua
>       close all
>       plot (1:10)
> 
> Does this produce a plot ?
> 
> In either event, you can set the GNUTERM environment variable in Octave's 
> initialization file. Edit ~/.octaverc and add the line "setenv GNUTERM aqua" 
> (don't include the quotes). To use the x11 terminal, use "setenv GNUTERM x11".
> 
> If you use TextEdit to edit ~/.octaverc, be sure to save the file as plain 
> text (Unicode UTF-8).
> 
> Another option is to use Fink or Macports to install gnuplot and Aquaterm. 
> You can also install recent versions of Octave with either of these package 
> managers. I'm currently using both of these (different computers), and have 
> not problems plotting.
> 
> The FLTK backend may also suit your needs. To use it (assuming your version 
> of Octave includes it) type ...
> 
>       graphics_toolkit fltk
>       close all
>       plot (1:10)
> 
Hi ~

This seems to be a recurrent question - see lengthy threads on this board 
starting 9.24.11 and 10.28.11.   I am running octave/gnuplot/aquaterm on OS X 
10.6 and would just add that in my case the connection between gnuplot and 
aquaterm is made through the the .bashrc file as follows:

cd ~
touch .bashrc
open .bashrc

The second line creates .bashrc if it doesn't already exist.  An editor should 
pop up. Put the following into it (without the #comments) , save and quit:

export PATH=$PATH:/usr/local/bin      # this provides the path to both octave 
and gnuplot on my system and may be different for you ... since both 
applications appear to be working independently for you already, you can 
probably leave this out.

export GNUTERMAPP=/Applications/AquaTerm.app   # this is the critical link that 
seems missing in the discussion to date.  It assumes Aquaterm is a package in 
your top level Applications directory - if not, modify the path accordingly.

export GNUTERM=aqua   # another way to setenv

To make bash aware of these new settings, you must make it re-read the .bashrc 
file.  An easy way of doing that is running the following command:

source .bashrc

This probably should all be done in an .octaverc file, but this was how it was 
shown to me and I haven't found the need to change it.

good luck

Stu




reply via email to

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