From: John H. <jdh...@ac...> - 2003-12-15 20:37:27
|
>>>>> "Christopher" == Christopher Fonnesbeck <ch...@fo...> writes: Christopher> First off, I want to congratulate the authors of Christopher> matplotlib for making a great package. This is the Christopher> python plotting library I've been waiting for. Thanks! 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. Christopher> produces Markov chain Monte Carlo simulations. At the Christopher> end of the simulation, I try to plot traces and Christopher> histograms of all of the sampled values. However, Christopher> matplotlib gets stuck on the first plot. After Christopher> calling show(), it does not move to the next line of Christopher> code for some reason, but instead hangs. When I try Christopher> and close the plot manually, it terminates the python Christopher> code. How can I get matplotlib to produce a new plot Christopher> each time it is called, moving on after each plot is Christopher> produced, displayed and saved to file. Here is a Christopher> sample function from my code: 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. JDH |