Octave graphic error with the gnuplot installed(with aqua) - macos

I installed the Octave in OSX 10.11.1 with Homebrew. And while I running the following code:
plot(x,y);
It turns out this:
gnuplot> set terminal aqua enhanced title "Figure 1" font "*,6.66667" 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'.
But, actually, I installed the gnuplot with aqua first. And I set the setenv('GNUTERM','aqua') in Octave.
while I enter the gnuplot, after typedset term it shows the list with aqua.
So, I am confused about the problem. how this aqua does not work?

Related

Octave freeze when it needs to plot

I have a problem ploting from Octave. Octave and Gnuplot are installed with Homebrew on OS X El Capitan, and after trying to do first plot, I got error:
set terminal aqua enhanced title "Figure 1" size 560 420 font
"*,6" dashlength 1
This problem is fixed using instructions from this answer, in short:
brew uninstall gnuplot
sudo ln -s /Library/Frameworks/AquaTerm.framework/Versions/A/AquaTerm /usr/local/lib/libaquaterm.dylib
sudo ln -s /Library/Frameworks/AquaTerm.framework/Versions/A/AquaTerm /usr/local/lib/libaquaterm.1.0.0.dylib
sudo ln -s /Library/Frameworks/AquaTerm.framework/Versions/A/Headers /usr/local/include/aquaterm
brew install gnuplot --with-aquaterm
echo '
Now, when I do plot, eg. plot(rand(3)), then Octave just freeze, so I have to do Control-C to abort. When I try to plot directly from Gnuplot and set term aqua, it works and I get plots. But in Octave, when I want to set term aqua or set term, it reports:
error: invalid conversion from string to real N-d array error: set:
expecting graphics handle as first argument
Also, I tried with:
echo -E "setenv('GNUTERM','X11')" > ~/.octaverc
but that did not help either. I think the problem is with graphics_toolkit, but I do not know how to resolve this.
octave:1> graphics_toolkit aqua
error: graphics_toolkit: aqua toolkit is not available
error: called from
graphics_toolkit at line 81 column 5
octave:2> graphics_toolkit fltk
error: graphics_toolkit: fltk toolkit is not available
error: called from
graphics_toolkit at line 81 column 5
Update
Accepted solution works up until version 4.2.0-rc2, so now check the update in the answer for more information.
I noticed when I enter command available_graphics_toolkits it only shows
ans =
{
[1,1] = gnuplot
}
and wheh I try with loaded_graphics_toolkits, it prints
ans = {}(1x0)
I guesed problem was with not loading GUI environment, so Octave was then recompiled with --with-gui option
brew reinstall octave --with-gui
and that solved a problem.
Update
According to this commit, from last September, version 4.2.0-rc2, --with-gui does not work anymore. So the best it to follow the instruction from Konstantin.
The accepted answer from miller didn't work for me, although available_graphics_toolkits and loaded_graphics_toolkits returned similar results. The octave package doesn't seem to have a --with-gui flag anymore.
Instead what I had to do to get it working was first brew reinstall gnuplot --with-x11 and then create a ~/.octaverc with the content
setenv("GNUTERM", "X11")
graphics_toolkit("gnuplot")
I did have X11 preinstalled.
The first plot after starting Octave 4 can last a while.
Reference: http://wiki.octave.org/Octave_for_MacOS_X
I had to update octave from 4.4.0 to the latest version 5.2.0 to get out of this.
But I still can't figure out why the previous version misbehaved in the first place.
setenv("GNUTERM","qt") from octave command line solved the problem for me!
See Cheng answer: https://stackoverflow.com/a/24596336/7190647

How to repair a terminal, once having been set to "set term xterm", to open X-Window and not showing just a messy code?

I'm using MacBook Pro running OSX 10.10 with XQuartz installed.
The Gnuplot version is 4.6.5.
After setting the terminal to xterm by typing "set term xterm", I can only get messy code in the terminal without other windows showing up.
Anyone knows how to solve it?
Here is a screen shot.
For me, the xterm terminal works only when also gnuplot was started from an xterm. Otherwise I do also see the 'messy' characters:
Call xterm.
Call gnuplot
Rund set terminal xterm; plot x on the gnuplot command line.
But do you really want to use the xterm terminal? I think using any other terminal like wxt, qt offers more possibilities.

Can't find x11 terminal in gnuplot Octave on Mac OS

I am running Mac OS Mavericks 10.9.4.
Installed Octave 3.8.1 via Homebrew which came with gnuplot 4.6
Have XQuartz 2.7.6 installed.
I restarted my computer after all was done.
In order to plot in octave-cli everyone states that I should just 'set terminal x11' BUT I don't even have x11 listed when I run 'set terminal' in gnuplot
Of course octave-cli will complain that my terminal is unknown.
octave:1> x=1;
octave:2> plot(x);
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
What did I do wrong? How can I debug this situation?
rami#ramis-macbook:~> gnuplot
G N U P L O T
Version 4.6 patchlevel 5 last modified February 2014
Build System: Darwin x86_64
Copyright (C) 1986-1993, 1998, 2004, 2007-2014
Thomas Williams, Colin Kelley and many others
gnuplot home: http://www.gnuplot.info
faq, bugs, etc: type "help FAQ"
immediate help: type "help" (plot window: hit 'h')
Terminal type set to 'unknown'
gnuplot> set terminal
Available terminal types:
canvas HTML Canvas object
cgm Computer Graphics Metafile
context ConTeXt with MetaFun (for PDF documents)
corel EPS format for CorelDRAW
dumb ascii art for anything that prints text
dxf dxf-file for AutoCad (default size 120x80)
eepic EEPIC -- extended LaTeX picture environment
emf Enhanced Metafile format
emtex LaTeX picture environment with emTeX specials
epslatex LaTeX picture environment using graphicx package
fig FIG graphics language for XFIG graphics editor
gif GIF images using libgd and TrueType fonts
gpic GPIC -- Produce graphs in groff using the gpic preprocessor
hp2623A HP2623A and maybe others
hp2648 HP2648 and HP2647
hpgl HP7475 and relatives [number of pens] [eject]
imagen Imagen laser printer
jpeg JPEG images using libgd and TrueType fonts
latex LaTeX picture environment
lua Lua generic terminal driver
mf Metafont plotting standard
mif Frame maker MIF 3.00 format
mp MetaPost plotting standard
pcl5 HP Designjet 750C, HP Laserjet III/IV, etc. (many options)
png PNG images using libgd and TrueType fonts
postscript PostScript graphics, including EPSF embedded files (*.eps)
pslatex LaTeX picture environment with PostScript \specials
pstex plain TeX with PostScript \specials
pstricks LaTeX picture environment with PSTricks macros
qms QMS/QUIC Laser printer (also Talaris 1200 and others)
regis REGIS graphics language
svg W3C Scalable Vector Graphics driver
tek40xx Tektronix 4010 and others; most TEK emulators
tek410x Tektronix 4106, 4107, 4109 and 420X terminals
texdraw LaTeX texdraw environment
tgif TGIF X11 [mode] [x,y] [dashed] ["font" [fontsize]]
tikz TeX TikZ graphics macros via the lua script driver
tkcanvas Tk/Tcl canvas widget [perltk] [interactive]
tpic TPIC -- LaTeX picture environment with tpic \specials
unknown Unknown terminal type - not a plotting device
Press return for more:
vttek VT-like tek40xx terminal emulator
xterm Xterm Tektronix 4014 Mode
I found the answer here. Basically gnuplot needs to be reinstalled as:
brew reinstall gnuplot --with-x11
This page also helps with troubleshooting Octave installation on Mavericks.
On El Capitan it shows error. So here's what you do:
Install Xquartz first...
brew reinstall gnuplot --with-qt
Open 'Xquartz' from Applications and NOT the 'Terminal'.
gnuplot
gnuplot > `set terminal xterm 6. plot sin(x)
You have at least three options:
brew reinstall gnuplot --with-x11
brew reinstall gnuplot --with-qt
brew reinstall gnuplot --with-qt5
The graphical quality of plots is much better with option 3 compared to option 1.

Color in Statusline not working for Vim 7.0 in OSX

I have tried using packages (powerline, airline, lightline) for coloring the statusline depending on the mode I am running, but none of them does the job. I am Vim 7.3 on OSX Mavericks.
Put set laststatus=2 in your ~/.vimrc to always have a statusline.
From :help 'laststatus':
The value of this option influences when the last window will have a
status line:
0: never
1: only if there are at least two windows
2: always
The screen looks nicer with a status line if you have several
windows, but it takes another screen line.

gnuplot: unrecognized terminal option

Can anyone tell me why I get the "unrecognized terminal option" when having
set output "out.pdf"
Is there any package that I need to install for gnuplot 4.4?
Have you set the terminal? The command
print GPVAL_TERMINALS
in gnuplot will list all the avialable terminals; if pdfcairo is in the list you should be good to go. In general before setting the output you need to set the terminal, e.g.
set terminal pdf
set output 'out.pdf'
Well, I had the same problem. I fixed this as follows using home-brew.
a) First to check what options are available with gnuplot
brew options gnuplot
This will produce something like :
--with-aquaterm
Build with AquaTerm support
--with-cairo
Build the Cairo based terminals
--with-libcerf
Build with libcerf support
--with-pdflib-lite
Build with pdflib-lite support
--with-qt#5.7
Build with qt#5.7 support
--with-test
Verify the build with make check
--with-wxmac
Build wxmac support. Need with-cairo to build wxt terminal
--with-x11
Build with x11 support
--without-gd
Build without gd based terminals
--without-lua
Build without the lua/TikZ terminal
--HEAD
Install HEAD version
b) uninstall gnuplot
brew uninstall gnuplot
c) reinstall with option cairo
brew install gnuplot --with-cairo
That's it. Afterwards, just set the terminal and provide output file. It worked for me.
set term pdf
set output 'myFile.pdf'
Another way is using the pipe gnuplot capability. For example with ps2pdf:
set term postscript eps enhanced color
set output '|ps2pdf - outputfile.pdf'
or with gs directly:
set output '|gs -sDEVICE=pdfwrite -sOutputFile=outputfile.pdf -dBATCH -dNOPAUSE -f -'
where the symbol - means the piped input file

Resources