Install Gnuplot

08 Apr

Basics of  how to install gnuplot and draw a basic graph with


-x and y axis labelled


-giving color to the line

– drawing multi-lined graph


On ubuntu 14.04

1. $ sudo apt-get update

2. $sudo apt-get install gnuplot

3. $sudo apt-get install gnuplot-x11

Run gnuplot


Draw a simple graph. Eg. A .txt file with two columns. First column having x-axis values. Second column having y-axis values.

$ plot ‘<filename.txt>’ with line

Few settings

Few of the following setting can be done to provide title, x-axis and y-axis labelling and to provide legends. once you have typed $gnuplot on your terminal and got a gnu prompt do the following according to your need.

set title “Title goes here” font “,14” textcolor rgbcolor “someColor”
set timefmt “%y/%m/%d”
set xlabel “time”
set ylabel “sales”
set pointsize 1
Now plot the graph. Say the file name is plot.dat. Type the following command.
>plot “plot.dat” using 1:2 with lines
to draw more then one graph in one plot do the following
>plot ‘<path to file1>’ with lines, ‘<path to second file2>’ with lines
That’s about it for now!
Leave a comment

Posted by on April 8, 2017 in Uncategorized


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: