help-octave
[Top][All Lists]
Advanced

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

Re: octave snow leopard


From: Ben Abbott
Subject: Re: octave snow leopard
Date: Tue, 03 Jan 2012 21:46:01 -0500

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)

Ben





reply via email to

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