From: Jeremy O'D. <je...@o-...> - 2004-03-19 11:41:52
|
Hi John, I'm (slowly) getting around to doing all of the things needed to bring backend_wx up to date (as far as possible). backend_wxagg will arrive, bu= t I'm trying to get some other things into backend_wx first, specifically: - Support for images (which is turning out to be trickier than I thought) - Support for the object picker (which should be easy) - Support Mathtext The problem of Mathtext support is a superset of the image support proble= m. The approach which I'm looking at is to use wxImage, which has a fast method for loading data (wxImage.SetData()) - ths expects a C string of length width*height*3 (in format RGBRGBRGB...). Not sure what format im.as_str() returns as I can't find any documentatio= n (the im parameter to RendererWx.draw_image() is an instance of matplotlib.image, I assume), so I'm stuck (or was a couple of nights ago)= . As you say, writing wxAgg is really pretty straightforward, and it's on m= y (ever lengthening) ToDo list... At the moment I don't have anything in a usable state. Regards Jeremy John Hunter said: >>>>>> "Flavio" =3D=3D Flavio Codeco Coelho <fcc...@ci...> >>>>>> writes: > > Flavio> Hi, I use matplotlib for a math modelling software. > > Flavio> I would like to create a figure, using the mathtext > Flavio> module, that would consist entirely of a list of > Flavio> equations. > > Flavio> This figure would be embedded in WX. > > Flavio> can anyone give me some pointer on how to get started? > > First port mathtext to wx <wink>. There are two ways to do this: > > * Write WXAgg: This is easier than you think. > > * Use the image_as_str method that ft2font provides to get a pixel > array from the math fonts and transfer them to the wx canvas using > the wx API. Something like draw_from_rgba. I don't know WX very > well. Is there a WX method that allows you to draw from a > character buffer or array? > > Jeremy earlier expressed some interest in WXAgg but I don't know what > the current status of that is. > > After that is done, we can move on to your question. Hint: see > examples/alignment_test.py for examples of laying out just text using > 0,1 coords. > > JDH > |