I am planning to make a lot of illustrations for basic mathematical and statistical concepts, but I am still hesitating about the drawing program to choose. I know a bit of Metapost and Asymptote, but I am not clear about the pros and cons of each of the vector drawing language. Especially, I’ve heard that Asymptote is somewhat “superior” to Metapost.
MetaPost is based on Knuth’s METAFONT, but is intended for figures in technical documents according to its primary author, John Hobby. I had hard time understanding its syntax when I discovered it. Asymptote was developed more recently.
So, what are the main differences between Metapost and Asymptote?
On the one hand, I like Metapost because it nicely fits within Context. It is also possible to typeset directly metapost code into a document, see MPlib: MetaPost as a reusable component, TUGboat, Volume 28 (2007), No. 3), and the luamplib package for Lua$\LaTeX$. My preferred textbook is still Metafun, from Hans Hagen:
A simple previewer was made available online by Troy Henderson.
Other useful references are:
- http://zoonek.free.fr/LaTeX/Metapost/metapost.html (French)
- http://melusine.eu.org/syracuse/metapost/ (French)
The current maintainer of MetaPost, Taco Hoekwater, recently announced the release of an alpha version of Metapost 1.5, but I didn’t switch. The MP version that comes with TeXLive is actually
$ mpost --version MetaPost 1.211 Copyright 2009 AT&T Bell Laboratories. There is NO warranty. Redistribution of this software is covered by the terms of both the MetaPost copyright and the Lesser GNU Lesser General Public License. For more information about these matters, see the files named COPYING, COPYING.LESSER and the MetaPost source. Primary author of MetaPost: John Hobby. Current maintainer of MetaPost: Taco Hoekwater.
On the other hand, Asymptote is arguably more recent and allows to work in 3D, and also plays nicely with animated PDFs. It is supposed to have a cleaner syntax (I suspect this is also a way to say that some people were quite reluctant to MP syntax), and correct drawing imprecision of Metapost (I should look into more details). There’s no internal solver, though; but there is a Metapost compatibility module.
Asymptote can also be used in interactive mode, which is very handy. I personnally added
.profile file so that EPS file are directly previewed using Apercu.app.
Other useful references are:
- http://marris.org/asymptote/ (French)
The Asymptote FAQ - Section 8 comes in mind first since it is dedicated to the differences between Asymptote and MetaPost. However, it appears that it merely concentrates on which Asy commands correspond to which MP instructions.
The most interesting thread I found on the web was MP vs. Asymptote (Laurence Finston, 2006). Unfortunately, it doesn’t provide an in-depth comparison of both languages, although I remain sensible to Finston’s arguments.
At risk of being old-fashioned, I like those kind of programs because we don’t have to bother with a complex or useless GUI. I must admit I never get used to xfig, and I didn’t reinstall it on my Mac: I should give a try to jfig. I know there is OmniGraffle available on OS X; I used it from time to time, but honestly I didn’t get ride of all of its features. Anyway, the Graphics page from the Context Navigator includes a lot of useful pointers for those interested in managing graphics and vector drawings with Context.
Ok, it turns out that I barely reviewed existing softwares for producing nice diagrams and drawing, and I still need to experiment MP and Asy a little bit more to get a definitive idea.