[SciPy-dev] Re: [AstroPy] Python version of IDL Astron library
rkern at ucsd.edu
Wed Sep 15 06:12:56 CDT 2004
John Hunter wrote:
> rendering: matplotlib still uses a variant of the gtk drawing model
> in the backend, which doesn't support arbitrary clipping paths,
> even-odd filling rules and the like. So I plan at some point to
> introduce a new drawing model and perhaps kiva would fit the bill.
> If matplotlib and chaco both used the same backend API then efforts
> on the backend of one package would be useful to the other. It
> would also make it easier to port frontend code from one package to
> another. Along these lines, I wonder how satisfied you are with the
> kiva API and implementation. I'm not sure this is the route I want
> to go, but it has come up in discussions with Perry and Paul on a
> couple of occasions and clearly has merit.
I think it works quite well. It needs some additions here and there.
* I've implemented color gradients on the Quartz backend, but not all of
the target backends support arbitrary functions for gradients.
* Elliptical arcs should be added (I did these for reportlab years ago,
so I guess I should do the same for Kiva).
* Font-finding is, um, sub-optimal.
> mathtext: As I mentioned at scipy, I would like to improve the
> mathtext layout engine. It's already decent, but there are
> definitely areas where it could be better. One good idea that came
> up at scipy was to use TeX where available, and I'm looking in to
> that. Almost all of the permutations off TeX that I've found thus
> far are GPL'd, which is unfortunate in my view because Knuth
> released TeX under an extremely permissive license -- basically the
> only restriction is that if you change the src, you must rename the
I don't think anyone is suggesting that matplotlib distribute any part
of TeX. Just use the programs if they are installed and manipulate the
output. Suggest other programs like dvipng as appropriate. Use os.system
and you don't have to worry about the GPL. Fall back to the current
approach when the programs are unavailable.
Kiva's Quartz backend can import PDF, so ideally, one can run pdftex on
the snippet and draw the vector data directly onto the Kiva canvas with
arbitrary transformation. Other backends will probably have to rely on a
raster intermediate or figure out a way to import PDF.
> In any case, whether I improve the matplotlib layout engine,
> expose tex, or both, chaco could probably reuse some of this code
> for mathematical expressions.
rkern at ucsd.edu
"In the fields of hell where the grass grows high
Are the graves of dreams allowed to die."
-- Richard Harter
More information about the Scipy-dev