From: Arnd B. <arn...@we...> - 2005-06-03 06:59:53
|
On Thu, 2 Jun 2005, William Henney wrote: > On Wed, 2005-06-01 at 13:25 -0500, John Hunter wrote: [...] > > For *Agg, we use tex + dvipng and load the output as a transparent, > > anti-aliased raster, caching the dvipng output in ~/.tex.cache for > > efficiency. For PS, we use tex + dvips + psfrag + latex + a patched > > ps2epsi. The latter is cumbersome, but it works. In an ideal world, > > we would simply use tex + dvips but embedding the postscript fragments > > generated by dvips in arbitrary locations on the figure, but this has > > proved challenging. > > Have you looked at how PyX (http://pyx.sourceforge.net/) handles things? > They have excellent support for tex/latex labels and it seems to be > implemented in a much "cleaner" way than you describe above. As far as I > can see, they run a single TeX job containing all the strings from the > current plot (see the texrunner class in pyx/text.py) and then parse the > dvi output themselves (see pyx/dvifile.py) just comment/question, which might be irrelevant, but still: would a PyX backend make sense? One approach could be to write out a python script with the PyX commands corresponding to the present graphics. (For example, one then could tweak the resulting script until the result is fine for publication...) > The big advantages matplotlib has over PyX in my opinion are a more > intuitive API and a larger/more-active developer pool and user base. Creating plots using PyX tends to need more code than with matplotlib. On the other hand PyX is *very* flexible which is reflected in its design. OTOH, the quality of PyX generated graphics exceeds anything else I have looked at in more detail. Also, it is easily possible to change the fonts and their size (+ linewidths, colors etc.) depending on whether one needs a graphics for inclusion into a publication (e.g. computer modern roman font) or a presentation (e.g. cmbright family) so that graphics and the text around it match nicely. The wish of a "front-end" to PyX did come up on the PyX mailing list, if I remember correctly. So maybe using a matplotlib+PyX-backend combination would be something useful. Best wishes, Arnd |