[SciPy-user] gplot documentation
Fernando.Perez at colorado.edu
Fernando.Perez at colorado.edu
Sun Aug 15 17:58:07 CDT 2004
Quoting Alan G Isaac <aisaac at american.edu>:
> On Sat, 14 Aug 2004, Fernando Perez apparently wrote:
> > 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.
>
>
> This post was extremely useful. One ambiguity remained for
> me: are you suggested PyX remains better than Matplotlib if
> you need LaTeX equations in your EPS files?
John already addressed the key points better than I can, so just let me add a
few details, since I realize my original post wasn't too clear on this point.
I think what I meant is best explained with a real world example:
http://amath.colorado.edu/faculty/fperez/tmp/04_03_ams_athens.pdf
contains examples of a fairly complex code which integrates mayavi, pyx and
gnuplot (read matplotlib for future uses, this was done months ago). All the
plots and figures you find there are actually methods built into my function
and operator objects, which makes interactive work a dream. They call
whichever library is best suited for a given task, whether it's 2d plots
(gnuplot/matplotlib), 3d surfaces (mayavi) or what I call 'diagrams' (pyx).
The distinction between what pyx does and tools like gnuplot/matplotlib is best
seen by looking at diagrams like those on pages numbered 6 and 8 (pyx diagrams)
vs the more common plots of page 5, for example.
Those diagrams, which represent adaptive decompositions of domains in 1 and 2d,
don't really fit into the normal definition of a 'plot', so they'd be very hard
to generate with a tool like gnuplot or matplotlib. Yet pyx, which is more of
an object-oriented frontend to Postscript, makes it very easy to produce them.
You get a canvas, and you can say 'put blue squares of this size at all these
coordinates, an arrow here, a label here, red squares here, fill these in,
etc'.
Perhaps matplotlib also offers tools for this task; with gnuplot it would
definitely be a major uphill battle to get it done. I'm sure you _could_, but
you would feel like you were beating your tool into doing something it wasn't
really designed for. PyX, on the other hand makes it very natural. A good
example of this is on the pyx page: the code to produce a beautiful Sierpinski
triangle is just a few lines, because the problem is so simple to express
algorithmically. For a 'plotting' program this would be a far less natural
task, I think.
I hope this clarifies where I see the two tools complementing each other, in
addition to John's comments.
Best,
f
More information about the SciPy-user
mailing list