12

i am following the great machine learning course given by Andrew Wu from Stanford. When I executed plot function in ex5 file, the octave cli command line reports the following warning:

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

WARNING: Plotting with an 'unknown' terminal.
No output will be generated. Please select a terminal with 'set terminal'.

The calculation works but all the graphs were not drew by plot. I tried set terminal qt or others like x11, but none of them worked. The solution in this post Can't find x11 terminal in gnuplot Octave on Mac OS does not work either.

my mac is Yosemite 10.10.3 my gnuplot is

G N U P L O T
Version 5.0 patchlevel 1    last modified 2015-06-07 
...
Terminal type set to 'unknown'

my XQuartz 2.7.7 (xorg-server 1.15.2)

Anyone knows how to fix? Thanks!

kenorb
  • 155,785
  • 88
  • 678
  • 743
Loro Tashi
  • 121
  • 1
  • 1
  • 4
  • You have a gnuplot binary that lacks the necessary aqua terminal for mac. Wherefrom have got it? – Karl Aug 19 '15 at 08:00

5 Answers5

12

Try reinstalling gnuplot --with-qt, e.g.

brew reinstall gnuplot --with-qt
kenorb
  • 155,785
  • 88
  • 678
  • 743
  • 1
    This worked for me, while setting up `terminal` was not enough. In my case I also add to install manually `jpegsrc` as explained in https://stackoverflow.com/questions/32703296/dyld-library-not-loaded-usr-local-lib-libjpeg-8-dylib-homebrew-php – loretoparisi Feb 04 '18 at 19:44
  • 1
    this is what i needed to do on Mojave. I probably had an earlier version of gnuplot installed and when I ran `brew install gnuplot --with-qt` it didn't override. – watsonic Oct 24 '18 at 23:35
  • 1
    This command didn't work for me. I was able to make it work with following changes `brew uninstall gnuplot` and then `brew install Caskroom/cask/aquaterm`. Then `brew install gnuplot --with-aquaterm --with-qt4`. – dheee Nov 26 '18 at 22:53
10

1) Open up terminal and try running

gnuplot

2) In gnuplot, run the command

set terminal

This should list all your available terminal types.

3) In octave, pick an available gnuplot terminal type and run setenv(). For example this could be

setenv('GNUTERM','qt')
setenv('GNUTERM','x11')

Hope this helps someone!

Kevin Lee
  • 1,370
  • 14
  • 22
4

I faced the same issue last night. The simplest solution I could find was to set terminal to qt from Octave.

setenv('GNUTERM','qt')

Now you can call plot as usual.

Akshay
  • 3,158
  • 24
  • 28
1

Try this: sudo apt install gnuplot-qt. It worked for me.

0

for me, what fixed it was:

brew install Caskroom/cask/aquaterm
brew upgrade gnuplot --with-aquaterm --with-qt4
rrr
  • 369
  • 4
  • 8