on SourceForge Logo

Quick links:

Intro is a Python package that interfaces to gnuplot, the popular open-source plotting program. It allows you to use gnuplot from within Python to plot arrays of data from memory, data files, or mathematical functions. If you use Python to perform computations or as 'glue' for numerical programs, you can use this package to plot data on the fly as they are computed. And the combination with Python makes it is easy to automate things, including to create crude 'animations' by plotting different datasets one after another.

Commands are communicated to gnuplot through a pipe and data either through the same pipe (as "inline" data), through FIFOs (named pipes), or through temporary files. It has been developed under Unix and is known to work under various forms of Unix (including Linux), MS Windows, MacOS, and Mac OS X. There is now also preliminary support for running under Jython/Java.

This package has an object-oriented design that allows the user flexibility to set plot options and to run multiple gnuplot sessions simultaneously. If you are more ambitious, it is not difficult to add entirely new types of plottable items by deriving from the 'PlotItem' class.

The package includes a demonstration that can be run by typing 'python'.


(2 May 2008) version 1.8 is out. This version includes bugfixes and improvements that have piled up since 1.7, including compatibility with NumPy. For more information, read the NEWS.txt file in the distribution.

(17 October 2003) version 1.7 is out. This version includes a change of license from GPL to LGPL, support for sending data to Gnuplot via FIFOs (named pipes) under unix, and preliminary support for running under Jython. For more information, read the NEWS.txt file in the distribution.


The quickest way to learn how to use is to install it then run the simple demonstration by typing 'python', then to look at the file to see the commands that create the demo. One of the examples is probably similar to what you want to do.

Don't forget to read the Gnuplot.html, README.txt and FAQ.txt files in the distribution.

HTML documentation for the Python classes is included in the doc/ directory of the distribution and is also available online. This documentation is extracted automatically from the package's docstrings using happydoc and is known to have some formatting problems. Alternatively, you can look at the docstrings yourself by opening the python files in an editor.

Finally, there is a mailing list for users. For more information about subscribing to the list or viewing the archive of old articles, please click here.

To get good use out of, you will want to know something about gnuplot, for which a good source is the gnuplot help (run gnuplot then type 'help', or read it online at the gnuplot website).


More detailed installation instructions are contained in README.txt.

Before you can use, you will need working versions of

If you want to run under MS Windows, make sure you have pgnuplot.exe (see the README.txt file for details).

To install

  1. Download either gnuplot-py-1.8.tar.gz or
  2. Gunzip and untar (or unzip) it, which will create a directory called gnuplot-1.8.
  3. Refer to README.txt in that directory for further instructions. Usually it should be enough to type python install.

You can also access the latest sources via Subversion. Click here for more information.

Copyleft is released under the GNU Lesser General Public License, which means that it can be freely copied and used, but that there are some restrictions on your rights to incorporate it into commercial products. See the LICENCE file for more information. (If these restrictions are a problem for you, please contact me to discuss the issue.)


The package was written by Michael Haggerty.

The package was inspired by and partly derived from the module written by Konrad Hinsen.

Berthold Höllmann submitted a file to be used with distutils.

Craig Schardt and Francois Ladouceur contributed changes that enable to work under MS-Windows. Tony Ingraldi contributed changes for the Macintosh.

Jannie Hofmeyr submitted a fix for Windows under Python 2.0.

Matthew Fulmer contributed a patch to add the filename argument to Data and GridData.

Thanks also to many other users who have submitted suggestions, bug fixes, and other feedback.

Written by Michael Haggerty (email <>)