Not able to get graphs on screen with gnuplot

I have installed 12.04 along with Windows 7 and also installed gnuplot 4.6.0.

When I type gnuplot on the terminal, I am getting the error message:

Terminal type set to unknown.

When I tried plot sin(x), the graph does not appear on the screen.

However, I am able to make a postscript file. I tried set terminal 'x11', system responds with:

unknown or ambiguous terminal. 

Please help me solve this problem.


Jotrocken's comment was spot on -- copying from the answer he linked to:

Just add gnuplot-x11 package via the terminal (CTRL+ALT+T):

sudo apt-get install gnuplot-x11

or via the software-center:

Install via the software center

It solved my plotting problems for GNUPlot in Octave!!!


I've had a similar problem with Ubuntu 10.04 64 bit. When gnuplot starts up, there's no default terminal type ("Terminal type set to 'unknown'"). If I then do

set term xterm

which is in the list returned by

set term

and then try to plot any function, all I get is gobbledygook. I've tried uninstalling gnuplot completely (via apt-get purge) from my computer and installing only gnuplot-x11, and doing a manual install from the gnuplot-4.6.0 package using the ./configure --with-x option with success. The only "solution" I've found is to use

set term dumb

and put up with a text-based graphic. This is ok for just checking the shape of a simple function. For more complicated functions, I've resorted to using the epslatex terminal and gv to view the output.

Is there anyone out there who's found a better and more complete solution?


I have succeed in installing gnuplot after installing the following libraries:

sudo apt-get install libx11-dev libxt-dev libreadline-gplv2-dev glib-2.0 

Using the first 3 allowed to use gnuplot. After installing glib-2.0 allowed me plot in a x11 terminal.