Scientific plotting with Pygist

Updated May 28, 2007; Pygist version 1.5.28 Gist is a scientific graphics library written by David H. Munro of Lawrence Livermore National Laboratory. It produces x-vs-y plots, 2-D quadrilateral mesh plots with contours, filled contours, vector fields, or pseudocolor maps on such meshes. Some 3-D plot capabilities are also available. PyGist is the corresponding extension module for Python. Until recently, PyGist was available for Linux/Unix machines only. Together with the good people at Livermore, we managed to port PyGist to Mac OS X, Windows, and Cygwin. For Mac OS X, there is both a native version of Pygist and an X11 version. For the latter, you need to install X11 for Mac OS X; the native version uses Quartz directly. Below you will find an installer for Windows, as well as the source distribution that can be used for Cygwin and Mac OS X. The installer for Windows works with Python's with Python run from the DOS prompt.
For some screen shots, click here: sinus, histogram, cardioids, colors, cellarray, gist3d, sombrero. You can get a demonstration of the capabilities of Pygist by executing
>>> from gist import gistdemolow
>>> gistdemolow.run()
You can find more examples in gistdemo3d and gistdemomovie.
Some useful commands:
>>> from gist import * # to import the gist graphics package
>>> window() # to open the window where the plots will appear
>>> x = arange(100) * 0.1 # this uses the Numerical Python package
>>> y = sin(x)
>>> plg(y,x) # Now you should see a sine wave in the graphics window
# Note that y comes first (so that the x can be optional)
>>> fma() # frame advance to go to the next plot
>>> y = arange(10)
>>> plh(y) # to draw a histogram
Pygist allows you to make postscript files of the plots that you made:
>>> hcp_file('myplot.ps') # opens a postscript file called myplot.ps
>>> hcpon() # From now on, write the plot to the postscript file after each frame advance
>>> fma() # frame advance
>>> hcpoff() # Stop writing plots to the postscript file

Manual

Pygist has many more capabilities, check out the manual (HTML, PDF) if you want to know more.

Installation instructions:

Known bugs and issues:

Running Pygist natively on Mac OS X

The native version of Pygist on Mac OS X uses Quartz and can be run directly from a Terminal window. To use the native version, you first need to make sure that you are using a framework installation of Python, otherwise the Pygist graphics windows won't interact correctly with the Mac's windowing system. A framework Python can be installed by adding --enable-framework to the configure script that is run when installing Python from the source. With versions of Python older than 2.5, you should run pythonw instead of python for the graphics windows to work correctly. With Python 2.5 and later, this is not necessary; you can simply use python.
To install Pygist, you will also need Numerical Python of course. Then, to install pygist, in the pygist-1.5.28 directory run
python setup.py config
python setup.py build
sudo python setup.py install
The first command will generate a lot of warnings and error messages. These are due to failed trial compilations and can be ignored. If you want to install the X11 version instead of the native Quartz version, then you need to add --x11 to these commands.
I built the native version of Pygist using version 10.3 of Mac OS X. Pygist should run with older versions also, except that the crosshair cursor is not available (you will get the usual arrow instead). If you have a single-button mouse, you can use the control and option key to simulate the other mouse buttons.

License information:

See the release notes for license information and disclaimer.