Bill Casselman's home page

PiScript - a drawing tool for mathematicians

PiScript is a package written by Bill Casselman in the programming language Python that interfaces in a straightforward way to PostScript graphics commands. It is designed for use by those who are interested in producing graphics in mathematical exposition. Its principal features are the directness of the interface and the ease with which one can insert TEX text into figures.

WARNING! PiScript currently runs only under the operating systems Linux and MacOSX.

Downloads, installation, updates

Go to the page

Documentation

Examples

You will see the Python file that produced an image if you click on it (assuming your browser is set to load .py files as text files, which it should do for security reasons). If you have installed a tool to view .eps files, you may also click on the file names beneath the image.

.eps

.eps

.eps

.eps

.eps

.eps

.eps

.eps

.eps

.eps

.eps

.eps

.eps

.eps

.eps

.eps

.eps
The following are multi-page displays:

.eps

.eps

.eps

.eps

.eps

Other links

Other graphics packages for mathematicians

  • PGF & TikZ. See also Kjell Fauske's home page and the page of TikZ examples.

    This is one of several packages that make pictures in a LaTeX environment, rather than TeX/LaTeX in a graphics environment, which I find by far preferable. Still, this pair of related programs do far better than others in this category. For example, there is a 3D package using Gene Ressler's Sketch, which has many interesting features, particularly the transparency effects. Still, if God had intended us to program in TeX ... As the discussion in the TikZ manual of its lowest level shows, at this level it is just a TeX interface to PostScript.

  • PSTricks

    This is in effect a fairly direct LaTeX interface to PostScript, and rather awkward. Almost a random walk through a small world of mathematics figures, little overall design, little control over output. PostScript is a rather interesting, even elegant, programming language, but LaTeX ... ? I find it curious that many graphics tools for mathematicians often assume that the user does not want to do any real programming. Mathematicians are notoriously conservative about computers, so maybe they have a point.

  • The Processing project

    More art than mathematics, but the images its enthusiastic users produce are often really beautiful.

  • MetaPost

    An interface to PostScript in Don Knuth's graphics language MetaFont, which he designed and used to make the Computer Modern fonts that come with TEX. By John Hobby, a former student of Knuth's. Much if not all of Knuth's own graphics is done with this tool (as you can see from Knuth's preprints page, particularly the color figures for dancing links), and it is therefore not to be scorned. To my eye, however, the figures it produces have a rather monotonous style, which indicates that variety, although possible in principle, is not easy to achieve. See also the Wikipedia entry on MetaPost.

  • From the home page: ... inspired by MetaPost, with a much cleaner, powerful C++-like programming syntax and floating-point numerics. It seems surprisingly powerful. Among other features, it has an interesting and sophisticated approach to keeping certain parts of a figure at a fixed size while scaling the rest (the sort of thing PiScript handles with its reversion routine revert).

  • Designed just to plot vector fields. So it has just one trick, but it's a good trick, and it performs it in a very sophisticated way.

  • PythonPS

    Another Python interface to PostScript programming from the very clever and amusing guy who brought you the PostScript web server PSD-HTTPD and much good PostScript advice. Very spare, and perhaps not actively maintained.

  • Among all the packages mentioned here, this is closest to PiScript. It handles TEX text in a similar fashion, but does not follow the PostScript graphics model very closely.

  • Similar in spirit as well as homonymous, but not a finished product (and it is not clear to me that it is still an active project, either). Like PYX, it does not follow PostScript as closely as I would like, but it does have interesting TEX text placement.

  • Matplotlib (which is used in SAGE)

    This models itself on MatLab. Very powerful for big data plotting tasks.

  • IPE

    By some of the authors of the fine book Computational Geometry, which is now in a third edition. The book is one of the few about algorithms in computer graphics that displays competent pictures. If the illustrations in the book were written with IPE, that's a good advertisement.

  • VRR

    Like IPE, this is an interactive graphics tool, rather than a programming tool. My impression is that neither of them is useful for mathematicians with little programming experience.

  • Cinderella

    Designed mainly as an interactive drawing tool, it has somewhere inside the scripting language CindyScript. Potentially very powerful.

  • The favourite of many for setting commutative diagrams, which it does well. Based on TeX.

  • A standard tool, used by multitudes. Ugly, ugly, ugly. But interactive. Not to say, well prepared.

  • Very limited.

NOTE: I welcome comments on any of these tools (mail to cass at math.ubc.ca). It would be extremely useful even to assemble a table comparing features such as
  • TEX and text handling
  • programming convenience
  • coordinate changes
  • library quality
  • 3D capability
  • control of graphics details
  • speed of rendering
  • ease of expansion
and whatever else distinguishes a good graphics program. It should include elementary samples of coding. But this is not a job for just one person.