Torch7: Gnuplot error

Created on 10 Apr 2015  路  3Comments  路  Source: torch/torch7

Hello, I've installed torch last night and was doing some tutorials and found an error with gnuplot. What could it be?

This is my code:

require 'gnuplot'

x=torch.linspace(-2*math.pi,2*math.pi)
gnuplot.plot(torch.sin(x))

and this is the error:

/Users/lucas/torch/install/bin/luajit: ...rs/lucas/torch/install/share/lua/5.1/gnuplot/gnuplot.lua:127: Gnuplot terminal is not set
stack traceback:
    [C]: in function 'error'
    ...rs/lucas/torch/install/share/lua/5.1/gnuplot/gnuplot.lua:127: in function 'getfigure'
    ...rs/lucas/torch/install/share/lua/5.1/gnuplot/gnuplot.lua:722: in function 'figure'
    ...rs/lucas/torch/install/share/lua/5.1/gnuplot/gnuplot.lua:288: in function 'getCurrentPlot'
    ...rs/lucas/torch/install/share/lua/5.1/gnuplot/gnuplot.lua:308: in function 'writeToCurrent'
    ...rs/lucas/torch/install/share/lua/5.1/gnuplot/gnuplot.lua:748: in function 'gnulplot'
    ...rs/lucas/torch/install/share/lua/5.1/gnuplot/gnuplot.lua:883: in function 'plot'
    plot-test.lua:4: in main chunk
        [C]: in function 'dofile'
    ...ucas/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:131: in main chunk
    [C]: at 0x0102b297a0

Most helpful comment

if you are on Ubuntu
sudo apt-get install gnuplot
sudo apt-get install gnuplot-qt

All 3 comments

This pertains to gnuplot having no viable terminals to use. If you are on OSX, then try this solution:
http://apple.stackexchange.com/questions/103814/cant-plot-with-gnuplot-on-my-mac

In the future, gnuplot issues can go here: https://github.com/torch/gnuplot

if you are on Ubuntu
sudo apt-get install gnuplot
sudo apt-get install gnuplot-qt

thank you raaka1

Was this page helpful?
0 / 5 - 0 ratings