Plotting data using Gnuplot

Note this tutorial was written for use with gnuplot 3.7, after the patent on the gif format expired gnuplot was released under the GPL, due to development of gnuplot the command syntax is less stable than before and I am liable to make errors, after learning basics you need to check with current documentation if you get errors.

Basically to use gnuplot you have to learn how to read the error messages and fix them

For current gnuplot documentation check documentation.

Instructions for installing gnuplot.

Gnuplot is an interactive plotting program which enables you to make attractive looking graphs. The approach may seem a little strange at first, because most people are now familiar with large spreadsheet packages, rather than using the command line. Because gnuplot concentrates on the job of plotting graphs, it can do it very well, generating very attractive professional looking graphs. At first the time and effort to generate one graph may seem large, but it becomes easier with experience, also it's a much faster way to produce multiple graphs, and allows you to have a consistent style. Often with spreadsheet packages, it isn't simple to achieve what you desire, or isn't very intuitive.

If you want to use gnuplot to plot functions, you can find other more useful tutorials on the web. A good tutorial for plotting functions is this Introduction to Gnuplot (way back).


For information including many links about gnuplot Gnuplot Central is a useful page. This gnuplot tutorial page is also useful for plotting data.

For an alternative Gnuplot tutorial, check Kawano's Gnuplot Tutorial

To make suggestions for improvements email me.

Example output

Example 1 - Plotting calculated values with experimental values.

Example gnuplot scripts to generate TTT diagram below, look here This graph is plotted from the tabulated output of the MAP program mucg73. By using conditional statements the curves for shear and displacive transformation can be plotted between the relevant temperatures only, without having to edit the data file. This plot is explained in Part 3 of the tutorial.


Example 2 - plotting multiple graphs with Multiplot

Multiplot example, this example shows how to plot multiple graphs in the same space. You can see the example script here.

Bifurcation Diagram demonstrating use of multiplot

Copying this document (this page, tutorial, and examples)

Copyright (c)   2003   Mathew Peet
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.

For complete documentation of gnuplot 3.7.1 check out the gnuplot manual.