From: Christopher F. <ch...@fo...> - 2003-12-15 21:13:55
|
On Dec 15, 2003, at 3:29 PM, John Hunter wrote: > > > Christopher> I'm trying to use matplotlib on OSX (so with WX > Christopher> rather than gtk) in conjunction with my own code that > > Not necessarily. pygtk, gtk-2, etc... have been packaged for fink. > I'm going to try and install them on my powerbook when I get a few > minutes. I like to avoid fink unless I absolutely have to use it -- it ends up installing a whole bunch of packages that I already have elsewhere on my machine, thereby creating the need to maintain multiple installations of the same package. ... I'm not sure why I'd want to use gtk instead of wx anyhow, given the choice. > > show must be the last line of your script. Is it possible to do all > the figures in the loop and then call show? If your number of figures > is very large, you could run into memory problems this way. There is > a work-around, but if you can do it all in memory that is the easiest > solution > > for i in range(1,10): > figure(i) > # do plot i > savefig('plot%d'%i) > show() > > This is an area that I am actively working on (in fact I was working > on it when you emailed!) so if this isn't a viable solution for you > let me know. I'm implementing some features to make it easier to use > matplotlib in with xvfb (virtual x) so you can produce plots in wx or > gtk without launching the GUI windows. > > I'm trying to keep my plotting in a separate module from everything else, so that I don't have to make changes all over the place when I change my plotting code. For example, plot_histogram() can be called from any other module without knowing how the plot is implemented. If I have to call show() from each module that uses the plotting module, it will start to get messy. Outside of the Plot module, the rest of my code shouldn't have to know anything about matplotlib. So, I'd like to be able to gererate and save a plot, then move on to the next piece of code. I'm trying to use your package in place of scipy, which is what I have been using to generate plots up until now; hopefully I can make it work. -- Christopher J. Fonnesbeck ( c h r i s @ f o n n e s b e c k . o r g ) Georgia Cooperative Fish & Wildlife Research Unit, University of Georgia |