[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Mac - problem with plotting
From: |
Ben Abbott |
Subject: |
Re: Mac - problem with plotting |
Date: |
Tue, 15 Jul 2014 07:59:09 -0400 |
On Jul 15, 2014, at 5:29 AM, Andrew Gibb <address@hidden> wrote:
>
> Ben Abbott wrote:
>> On Jul 8, 2014, at 12:27 PM, Andrew Gibb<address@hidden> wrote:
>>
>>> Hi,
>>>
>>> I can't seem to plot. I've just installed Octave using Homebrew on
>>> Mac OS Mavericks. If I do:
>>>
>>>> x = linspace(0,5);
>>>> plot(x, sin(x))
>>> I get
>>>
>>> gnuplot> set terminal aqua enhanced title "Figure 1" size 560 420
>>> font "*,6" dashlength 1
>>> ^
>>> line 0: unknown or ambiguous terminal type; type just 'set terminal'
>>> for a list
>>>
>>> However,
>>> octave:3> set terminal
>>> error: invalid conversion from string to real N-d array
>>> error: set: expecting graphics handle as first argument
>>>
>>> Which I guess is not what I should see.
>>>
>>> It is suspicious that the error message begins "set terminal aqua"
>>> irrespective of the value of GNUTERM. The result is the same for
>>> GNUTERM set to qt, aqua, or X11.
>>>
>>> The results are the same in the gui, or running Octave from a
>>> terminal prompt.
>>>
>>> I have installed aquaterm via the dmg from sourceforge, and homebrew
>>> has picked up the gnuplot dependency.
>>>
>>> Any ideas what's wrong here?
>>>
>>> Thanks
>>
>> It is likely that either your gnuplot was not compiled to plot using
>> MacOS Aqua interface, or the Aquaterm libraries are not where gnuplot
>> expects to find them. It is generally a good idea to build and install
>> Octave and all its dependencies using Hombrew (including Aquaterm, and
>> Gnuplot. However, since there is no Homebrew Aquaterm formula, you may
>> be out of luck there).
>>
>> In any event, I realize you've said that GNUTERM has no effect, but
>> you didn't say what you did.
>>
>> Please try the following commands from Octave's command line.
>>
>> close all
>> set GNUTERM x11
>> plot (rand (3))
>>
>> Also, there is good chance that the FLTK toolkit is supported. To find
>> out, run Octave via the command line (this will not work from the GUI)
>> and try ...
>>
>> close all
>> graphics_toolkit fltk
>> plot (rand (3))
>>
>> Ben
>>
> Ben,
>
> Thanks for your reply. To be explicit, I tried setting GNUTERM as an
> environment variable using a bash export command to each of X11, qt, or aqua.
> I then opened octave and did
>
> > x = linspace(0,5);
> > plot(x, sin(x))
>
> Each time this returned
>
> gnuplot> set terminal aqua enhanced title "Figure 1" size 560 420 font "*,6"
> dashlength 1
> ^
> line 0: unknown or ambiguous terminal type; type just 'set terminal' for a
> list
>
> Then I tried opening octave from a termial with GNUTERM unset, then tried
> using the octave command "set" to set GNUTERM to each of the same three
> values. Each time I call set GNUTERM, octave returns
>
> error: invalid conversion from string to real N-d array
> error: set: expecting graphics handle as first argument
>
> Then doing
> > x = linspace(0,5);
> > plot(x, sin(x))
>
> returns
> gnuplot> set terminal aqua enhanced title "Figure 1" size 560 420 font "*,6"
> dashlength 1
> ^
> line 0: unknown or ambiguous terminal type; type just 'set terminal' for a
> list
> irrespective of what GNUTERM is set to. I hope that's a little clearer.
>
>
> Here's the output from the commands you suggested (I installed fltk via
> homebrew and started a new terminal):
>
> octave:1> close all
> octave:2> set GNUTERM x11
> error: invalid conversion from string to real N-d array
> error: set: expecting graphics handle as first argument
> octave:2> plot (rand (3))
>
> gnuplot> set terminal aqua enhanced title "Figure 1" size 560 420 font "*,6"
> dashlength 1
> ^
> line 0: unknown or ambiguous terminal type; type just 'set terminal' for a
> list
>
> octave:3>
>
>
> octave:3> close all
> octave:4> graphics_toolkit fltk
> error: graphics_toolkit: fltk toolkit is not available
> error: called from:
> error:
> /usr/local/Cellar/octave/3.8.1/share/octave/3.8.1/m/plot/util/graphics_toolkit.m
> at line 70, column 5
> octave:4> plot (rand (3))
>
> gnuplot> set terminal aqua enhanced title "Figure 1" size 560 420 font "*,6"
> dashlength 1
> ^
> line 0: unknown or ambiguous terminal type; type just 'set terminal' for a
> list
>
> octave:5>
>
> Andy
The problem is that the default configuration of Homebrew's gnuplot doesn't
support any terminals for displaying the plots. To add support for x11, ...
brew uninstall gnuplot;
brew install gnuplot --with-x
I don't know if Homebrew supports qt or not. You might experiment with that
... or ask the Homebrew help list.
Homebrew definitely doens't provide Aquaterm. But if you are up to a bit of
hacking, you'll first need to download and install Aquaterm
http://sourceforge.net/projects/aquaterm/
And then setup the Homebrew build of gnuplot to link to the Aquaterm libs. If
you need help with that, please inquire on the Homebew and/or gnuplot help
lists.
Beware of multiple installs of Aquaterm and/or gnuplot. You'll save yourself a
lot of head-aches if you only have one of each installed on your computer.
Ben