plotting in Octave
Ben Abbott
bpabbott at mac.com
Sat Nov 22 09:07:31 CST 2008
On Nov 22, 2008, at 9:04 AM, Robert Fong-tom wrote:
>
> On Nov 22, 2008, at 3:41 AM, Ben Abbott wrote:
>
>>
>> On Nov 22, 2008, at 12:29 AM, Robert Fong-tom wrote:
>>
>>> I finally was successful in porting Octave via macports and all
>>> seems
>>> to be well. However, now I can't plot. The error I get is:
>>>
>>> gnuplot: unable to open display ':0'
>>> gnuplot: X11 aborted.
>>>
>>> I had this problem before when I had installed Octave via the binary
>>> dmg file at SourceForge, and as far as I can tell the .profile,
>>> shown
>>> below, file is correct. Any thoughts?
>>>
>>> # Make X11 the default
>>> export GNUTERM=x11
>>> robert-fong-toms-computer:~ robert$ cat .profile
>>> # Make X11 the default
>>> export GNUTERM=x11
>>>
>>> ##
>>> # Your previous /Users/robert/.profile file was backed up as /Users/
>>> robert/.profile.macports-saved_2008-11-20_at_19:39:45
>>> ##
>>>
>>> # MacPorts Installer addition on 2008-11-20_at_19:39:45: adding an
>>> appropriate PATH variable for use with MacPorts.
>>> export PATH=/opt/local/bin:/opt/local/sbin:$PATH
>>> # Finished adapting your PATH environment variable for use with
>>> MacPorts.
>>>
>>>
>>> # MacPorts Installer addition on 2008-11-20_at_19:39:45: adding an
>>> appropriate DISPLAY variable for use with MacPorts.
>>> export DISPLAY=:0
>>> # Finished adapting your DISPLAY environment variable for use with
>>> MacPorts.
>>>
>>> Bob
>>
>>
>> What do you get when you type the following into Octave's window?
>>
>> system ("echo $DISPLAY");
>> system ("echo $GNUTERM");
>>
>> For me, I get
>>
>> octave:4> system ("echo $DISPLAY");
>> :0.0
>> octave:5> system ("echo $GNUTERM");
>> aqua
>> octave:6>
>>
> When I type the above I get:
>
> octave:1> system("echo $DISPLAY")
> :0
> ans = 0
> octave:2> system("echo $GNUTERM")
> x11
> ans = 0
>
>> I assume you are still running OSX 10.4.x ?
> Yes, I am still running OS X 10.4.x
>>
>> I'm not familiar with what MacPorts installs for octave. Did you
>> start a Terminal window and type "octave" into it?
> Yes
>>
>> Have you tried starting an xterm window and running octave from
>> there?
> Yes. Octave does not run. I get the error "Command not Found"
>>
>> You do have X11 installed correct?
> Yes
>>
>> Ben
>
> I don't know if you saw Carlo's response, but although I am running
> 10.4.x, I tried starting X11 before plotting and it worked!!!
>
> What do you suppose is happening?
>
> How do I switch back to Aquaterm?
To use aquaterm replace
export GNUTERM=x11
with
export GNUTERM=aqua
Regarding Marius' suggestion to run "bash --login", you can edit
~/.xinitrc and add that to the top of the file. If you have no
~/.xinitrc, copy the default system version from /private/etc/X11/
xinit/xinitrc.
Ben
More information about the Help-octave
mailing list