[SciPy-user] gplot documentation

Fernando Perez Fernando.Perez at colorado.edu
Sat Aug 14 20:22:18 EDT 2004


Jeremy Martin wrote:
> List,
> 
> Im new to using Scipy and was wondering where to look for 
> documentation on gplot. Ive looked at the gnuplot webpage but havent 
> found any sections that resemble the functions in the plotting 
> tutorial. 

With no offense to the core scipy team (I'm an avid user of scipy for all my
work _except_ plotting), I think you'd be better served right now with another
alternative.  Scipy has been slowly developing a very ambitious graphics
framework called Chaco, but the project isn't really useful to end users yet.

I personally have been using Gnuplot.py (with the additions provided by
ipython, which IMHO are absolutely critical to real-world efficient use,
especially interactively).  But I have been keeping a close eye on matplotlib,
and with the latest release (from this past Monday), I think it passed a
turning point in usability.  Now, I've started promoting it to my coworkers
who didn't have tons of gnuplot-based scripts like I do.  I will probably
transition more slowly, but I'm already working on giving ipython
gtk-threading support so it integrates nicely with all of matplotlib's backends.

In case you are curious, the key additions to matplotlib which just made it
pass _my_ criteria were:

1. Mathtext (latex equations) support in the PS/EPS backend.  This is
absolutely critical for our regular latex-based workflow.

2. Zooming/panning in the interactive plot windows.  I pestered John to add to
matplotlib these features in the manner which gnuplot 4.0 supports (I use them
constantly, and they are critical to my daily workflow).  He was extremely
receptive to all my suggestions, and they were available in short order.

I _really_ like matplotlib, because it provides today a system which matches
the various usage scenarios I need:

- concise, efficient syntax for quick interactive use.  One-off plots of data
when developing code, where you need zero fancy features, but you need to do
them quickly and with the _absolute_ minimum amount of typing possible.
plot(x) should simply plot the x array against its indices.

- a real object-oriented framework for more complex things where the plots are
generated by a program.  There, extreme conciseness is not the key feature.
Instead, a clean object model with programmatic access to all parts of the
graph is critical.

- the ability to plot either to screen or to generate many plots to eps on 
disk without ever opening a gui.  I have automated test suites which need to 
run without opening a plotting window, but make many plots as they go.

- the same library also exposes its functionality as widgets for wxpython. 
This means that making a gui program which needs sophisticated plotting is not 
a problem anymore (that's simply impossible with gnuplot, which was never 
conceived for such purposes).

Besides, it has:

- easy generation of all common image formats

- array plotting as colormaps. For image processing and even a lot of linear 
algebra things, this is very useful and non-existent in gnuplot (I think there 
are patches around for it, but it's not in mainline).

Matplotlib still has a few rough edges, but it's improving steadily and I see 
the overall foundations as being solid enough, that I'm willing to bet my own 
time by working on ipython support for it.

I think that the following trio of systems makes an extremely good base for 
the graphical side of scientific work today in python:

- Matplotlib: regular 2d plots (interactive or scripted), array/image plots, 
gui-building.

- MayaVi: sophisticated 3d visualization, volumetric rendering, etc.

- PyX: algorithmic generation of high-quality postscript diagrams with latex 
equations.

Replacing matplotlib with gnuplot at this moment, I have incorporated these 
tools into fairly complex codes in a very smooth way.  After having fought the 
hell of IDL (matlab is probably similar), the power these tools provide, and 
their simplicity and elegance, are really a pleasure.

I hope this is useful.

Best,

f





More information about the SciPy-User mailing list