Carl Worth wrote: > On Thu, 05 Jul 2007 13:22:11 -1000, Eric Firing wrote: >> I have made a few changes in svn to facilitate testing cairo with >> backend_driver (and to fix a bug that turned up), and I will do a bit >> more on this later today or tomorrow. > > Cool. I've started downloading all the matplotlib source history with > git-svn, so once that's done I'll take a look. Hopefully it's obvious > how to run through the cairo backend with the test suite---otherwise > I'll ask. > >> The result of a quick pass >> through the backend_driver test with png output is quite encouraging, >> though. There are some bugs in string placement, image handling, and >> clipping, but most things work, including mathtext. Default fonts seem >> to be different. > > If there's anything I can do to help I'll do what I can---let me know.
Thanks. One place to start would be with the string placement. If you compare png output from Cairo vs Agg, I think you will find that strings are being positioned differently, sometimes very subtly, sometimes (especially for plot title) by quite a bit. If you can figure out where the differences are coming from, we can decide whether changes are needed in Cairo, in one or more of the other backends, or both. (I think SVG also positions strings quite differently; I think ps positioning is much closer to Agg.) > > Oh, and I meant to say that it's a bit annoying that > savefig("somefile") doesn't work with the cairo backend. My > understanding is that this is supposed to automatically select the > correct file extension based on the backend type, (with the implicit > assumption that any given backend only supports one backend type). > > That seems like a useful way of using savefig, and I don't think it's > correct to break it just because cairo supports multiple file types. > > My suggestion would be to make it default to .png if no additional > information is provided, and then to also add some sort of pseudo Yes, I was looking at making that the default. > backends so that the other cairo-supported file types could easily be > obtained with this same savefig call. For example something like: > > python myscript.py -dCairoPDF > > What do you think? Would that be simple to implement? I think it would be easy. It might be done most easily and consistently via the rc mechanism. Figure.savefig already has a kwarg for it, so it would be a matter of having that kwarg default to the rc setting. For the backend specification I would suggest "-dCairo.pdf" etc, which is mnemonic and easy to parse. Eric > > -Carl > > PS. I'd be more inclined to name the backends things like cairo-pdf > than CairoPDF but it seems that the latter better fits the existing > convention for matplotlib backend naming. ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ Matplotlib-devel mailing list Matplotlib-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-devel