# Download source code
Code: Select all
wget http://sourceforge.net/projects/gnuplot/files/gnuplot/5.0.3/gnuplot-5.0.3.tar.gz
Code: Select all
tar -xvzf gnuplot-5.0.3.tar.gz
Code: Select all
cd gnuplot-5.0.3
Code: Select all
./configure
Code: Select all
make
Code: Select all
sudo make install
Code: Select all
make clean
Code: Select all
make distclean
Code: Select all
cd ..
rm -r gnuplot-5.0.3
# Return to the parent/Home directory
Code: Select all
cd ../../
Code: Select all
echo "Gnuplot was successfully installed and works like a charm!"
Code: Select all
gedit ~/.bashrc &
Code: Select all
# enable autocompletion in gnuplot
alias gnuplot="rlwrap -a -c -b\"\\\"\\\"\\\'\\\'\" gnuplot"
These instructions can easily be adapted for higher versions of Gnuplot on Unix machines.
Let's now test the Gnuplot by pltotting some data. Create a folder named "Gnuplot" on the Desktop, download some data file from here, and save it in the directory Gnuplot. The name of the file is 'testResults.dat'.
Open the Terminal and move to the directory by typing
Code: Select all
cd Desktop/Gnuplot/
Then type in the command prompt
Code: Select all
p 'te
Try to plot with lines, by typing in the command line prompt
Code: Select all
p 'testResults.dat' w l
Finally, plotting using the command
Code: Select all
p 'testResults.dat' using 1:2 with boxes
See also http://www.gnuplotting.org/output-terminals/, set terminal to x11
Note: After installing and instantiating Gnuplot, you may encounter the problem 'Terminal type set to unknown', this is usually caused by some missing dependencies mentioned at the end of the script generated after issuing ./configure command. You may see something like this:
Code: Select all
wxt terminal: no (requires C++, wxWidgets>2.6, cairo>0.9, pango>1.10)
Qt terminal: no (use --with-qt or --with-qt=qt4 to enable
At this stage you may need to uninstall (and re-install again, later, after installing all the required dependencies) gnuplot, depending on the version you have installed, by typing
Code: Select all
sudo apt-get remove gnuplot5
Or
Code: Select all
sudo apt-get remove --auto-remove gnuplot5
See more uninstall alternatives.
To install Cairo package go to http://www.linuxfromscratch.org/blfs/vi ... cairo.html or https://launchpad.net/ubuntu/+source/ca ... .6-1build1 and http://askubuntu.com/questions/108662/h ... iro-1-8-10
For Pango install, check http://www.linuxfromscratch.org/blfs/vi ... pango.html