Introduction to Gnuplot


gaussiansGnuplot is a command-line based utility for creating graphs. It runs on major operating system flavors including Windows, Linux and MacOS. It is free and open-source. It can create 2D and 3D graphs in various output formats including pdf, png, gif, jpeg, LaTeX, svg and even HTML5!

But why use gnuplot when you can create graphs in Excel?

  • Excel graphs are raster images (e.g. JPEG).
  • Excel graphs have only limited customization.
  • Excel cannot process external data files.
  • Excel is designed for financial functions it is not suitable for scientific works.

How to download and install gnuplot on Windows?

  1. Download it from
  2. The downloaded ZIP file would look like, extract it in My Documents.
  3. To run it, open the file wgnuplot from C:/Documents and Settings/username/My Documents/gnuplot/bin


How to download and install gnuplot on Ubuntu?
1. Open terminal and type: apt-get install gnuplot. It will install gnuplot for you.
2. To run it, open terminal and type command gnuplot.

Plotting your first graph using gnuplot
Open gnuplot, type plot sin(x) and press enter key. Done! You just plotted your first graph using gnuplot.

sin (x) function plotted using gnuplot
sin (x) function plotted using gnuplot

In upcoming posts, I will try to elaborate on plotting. If you cannot wait, you can directly try these plotting demos.

1 comment

Leave a comment

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

You are commenting using your 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: