## [Matplotlib-users] to plot a pixmap in a plot

 [Matplotlib-users] to plot a pixmap in a plot From: Jean-Baptiste Cazier - 2003-09-11 18:39:04 ```S=E6ll ! I recently discovered the matplotlib project with great pleasure. It is already fulling many of my wishes linked to python development However there is a function I would love to have, and it should be straight= forward to implement eventhough it is not in the matlab spirit: - I would like to be able to get a plot based on an existing pixmap - This way I would be able - to get the nice tools provided by the figure,= axes, zooming, etc.. - keep a consistent presentation of my many plots - As figures in matlibplot are supposed to be pixmaps in axes this should b= e fairly easy to implement instead of havinf plot(x,y) it would be plot(pixmap) If on top of that I could use the pixmap as a background of other plot, (pl= ot (pixmap, x,y) it would be even better Any idea on how this could be done ? Takk Kve=F0ja Jean-Baptiste --=20 ----------------------------- Jean-Baptiste.Cazier@... Department of Statistics deCODE genetics Sturlugata,8 570 2993 101 Reykjav=EDk ```

 [Matplotlib-users] to plot a pixmap in a plot From: Jean-Baptiste Cazier - 2003-09-11 18:39:04 ```S=E6ll ! I recently discovered the matplotlib project with great pleasure. It is already fulling many of my wishes linked to python development However there is a function I would love to have, and it should be straight= forward to implement eventhough it is not in the matlab spirit: - I would like to be able to get a plot based on an existing pixmap - This way I would be able - to get the nice tools provided by the figure,= axes, zooming, etc.. - keep a consistent presentation of my many plots - As figures in matlibplot are supposed to be pixmaps in axes this should b= e fairly easy to implement instead of havinf plot(x,y) it would be plot(pixmap) If on top of that I could use the pixmap as a background of other plot, (pl= ot (pixmap, x,y) it would be even better Any idea on how this could be done ? Takk Kve=F0ja Jean-Baptiste --=20 ----------------------------- Jean-Baptiste.Cazier@... Department of Statistics deCODE genetics Sturlugata,8 570 2993 101 Reykjav=EDk ```
 Re: [Matplotlib-users] to plot a pixmap in a plot From: John Hunter - 2003-09-11 19:06:38 ```>>>>> "Jean-Baptiste" == Jean-Baptiste Cazier writes: Jean-Baptiste> If on top of that I could use the pixmap as a Jean-Baptiste> background of other plot, (plot (pixmap, x,y) it Jean-Baptiste> would be even better Jean-Baptiste> Any idea on how this could be done ? Yes, this should be fairly easy to implement, since all the drawing commands draw to a gtk.gdk.Drawable, of which pixmap is a derived class. When I make the hardcopy (png or tiff) I am already using a blank pixmap as the background, so it should be fairly easy to add a command to the Figure API, which is set_background_pixmap, and then allow you to plot on top of it (or just use the pixmap alone). I will take at look at this and get back to you. Thanks for the suggestion, John Hunter ```
 [Matplotlib-users] pie charts From: Charles R. Twardy - 2003-09-13 12:03:24 ```How hard would it be to add pie charts? Or have I missed them?? How would one do this? Patches? Or: how many coffees to sponsor it? -Charles -- Charles R. Twardy, Res.Fellow, Monash University, School of CSSE ctwardy at alumni indiana edu +61(3) 9905 5823 (w) 5146 (fax) ```
 Re: [Matplotlib-users] pie charts From: John Hunter - 2003-09-13 14:59:53 ```>>>>> "Charles" == Charles R Twardy writes: Charles> How hard would it be to add pie charts? Or have I missed Charles> them?? How would one do this? Patches? Or: how many Charles> coffees to sponsor it? I've been thinking about adding pie charts. I never use them in my own research, but I know the rest of the world, particularly the business world, does. A "wedge" patch would be the appropriate primitive, combined with a pie chart function that drew the wedges in the right place. I have never used a pie chart in matlab -- I'm curious to know what kind of patch primitive they use. However, there is no existing patch class is particularly suited for drawing a wedge, but it would be easy to implement using the drawable draw_arc method combined with a fill; basically just follow the lead of draw circle and change the angles of the arc. If you want to take a stab at it, that would be great! BTW, as I've alluded to in previous posts, I have reworked the backend considerably, and can now make plots with GTK, PS and GD module. I'll update CVS monday morning. This doesn't much affect the patch classes, because the patch is an abstraction which calls the renderer primitives eg, draw_arc, draw_rectangle, and all the backends support these calls. In any case, I'll get around to adding it myself if you don't want to take it on (and will hold you to those coffees next time I'm down under!), but I have a few other feature request and bug fixes in the que to tackle first. JDH ```