PGPLOT Graphics Subroutine Library

Contents

New Web Addresses

The web address for PGPLOT changed in October 2000. The new web address is
http://www.astro.caltech.edu/~tjp/pgplot/
and the ftp address for downloading PGPLOT is
ftp://ftp.astro.caltech.edu/pub/pgplot/pgplot5.2.tar.gz

Introduction

The PGPLOT Graphics Subroutine Library is a Fortran- or C-callable, device-independent graphics package for making simple scientific graphs. It is intended for making graphical images of publication quality with minimum effort on the part of the user. For most applications, the program can be device-independent, and the output can be directed to the appropriate device at run time.

The PGPLOT library consists of two major parts: a device-independent part and a set of device-dependent ``device handler'' subroutines for output on various terminals, image displays, dot-matrix printers, laser printers, and pen plotters. Common file formats supported include PostScript and GIF.

PGPLOT itself is written mostly in standard Fortran-77, with a few non-standard, system-dependent subroutines. PGPLOT subroutines can be called directly from a Fortran-77 or Fortran-90 program. A C binding library (cpgplot) and header file (cpgplot.h) are provided that allow PGPLOT to be called from a C or C++ program; the binding library handles conversion between C and Fortran argument-passing conventions.

PGPLOT has been tested with UNIX (most varieties, including Linux, SunOS, Solaris, HPUX, AIX, Irix, and MacOS X/Darwin) and OpenVMS operating systems. I am unable to provide support for DOS, Microsoft Windows, but I do distribute code provided by users for use with these operating systems.


Examples

Some example graphs showing some of the capabilities of PGPLOT, and source code in Fortran and C for a simple example, can be found in the PGPLOT Portfolio. Caution: this page contains several large graphics files.

Copyright

PGPLOT is not public-domain software. However, it is freely available for non-commercial use. The source code and documentation are copyrighted by California Institute of Technology, and may not be redistributed or placed on public Web servers without permission. The software is provided ``as is'' with no warranty.

Status

The current version of PGPLOT is 5.2.2.

Installation

For instructions for obtaining PGPLOT from my ftp site and for details of supported operating systems, read the installation instructions.

If you cannot use ftp, PGPLOT is available on tape for a fee. Consult tjp·astro.caltech.edu.


Documentation

The manual PGPLOT Graphics Subroutine Library by T. J. Pearson is being updated for version 5.2 of PGPLOT. A draft of the manual is available: see the Table of Contents.

A PostScript file of the manual will be made available when it is completed. A PostScript file of the old manual (version 4.9, 0.27 Mbyte, gzipped) is still available, but it does not include the many changes made in version 5.0.


Calling PGPLOT From Other Languages

PGPLOT is distributed with subroutine interfaces for C and Fortran-77; these interfaces can also be used with C++ and Fortran-90.

Several users have contributed bindings for PGPLOT that allow the PGPLOT functions to be called from other languages. Several of these bindings allow PGPLOT to be used interactively.

ADA
Martin Stift has an ADA and ADA95 interface to PGPLOT.
C++
CCPL is an interesting graphing library interface for use with C++. A graph is generated by sending data to a stream, e.g., pout << line_plot(my_data) << endp;. Author: Matt Howlett (University of Tasmania). URL: http://ccpl.sourceforge.net.
GLISH
A PGPLOT binding for GLISH has been developed as part of the aips++ project by a consortium led by the National Radio Astronomy Observatory; it is currently in beta release.. For details, see the aips++ web page.
OCTAVE
PGPLOT may be called from the Octave language for numerical computations via Matwrap from Gary Holt.
PERL
PGPERL by Karl Glazebrook provides an interface between the Perl language and the PGPLOT FORTRAN library. For further information, see the WWW page http://www.aao.gov.au/local/www/kgb/pgperl/.
PYTHON
(But why would you want to use PGPLOT when you can use matplotlib?)
Pygplot by Chris Burns is a python module which provides the user with a friendly, object-oriented interface to the PGPLOT plotting library:
http://code.obs.carnegiescience.edu/python/burns-python-scripts/pygplot/pygplot.pdf
http://code.obs.carnegiescience.edu/python/burns-python-scripts/pygplot
Nick Patavalis (npat at efault.net) has developed an interface between PGPLOT and the Python and NumPy languages. See https://github.com/npat-efault/ppgplot.
RUBY
Ruby/PGPLOT is a PGPLOT interface to the Ruby language, written by Masahiro Tanaka.
SCHEME
Koji Ejiri has made a Gauche binding for PGPLOT. Gauche is a Scheme interpreter.
TCL/TK
Tcl/Tk interfaces for PGPLOT have been developed by three groups:
YORICK
A PGPLOT interface to the Yorick language has been written by Alexey Goldin (alexey@oddjob.uchicago.edu). See http://flight.uchicago.edu/goldin/yorick-pgplot/.

Interactive Drawing Programs and Other PGPLOT Extensions

The following list does not include the many application-specific programs that have been written using PGPLOT.

Reporting problems

If you have questions about PGPLOT, please send them to Tim Pearson, preferably by e-mail. If you have a problem with installation, please include information about your operating system version, Fortran and C compilers, and the version of PGPLOT you are trying to install. If you think you have found a bug in PGPLOT, a simple test program in Fortran or C that demonstrates the problem is very helpful.


Tim Pearson, California Institute of Technology, tjp·astro.caltech.edu
Copyright © 1995-2017 California Institute of Technology