* One of the most obvious obstacles at the moment is that I'm plotting surface plots, using contour[f] primarily, and haven't found an obvious way of removing 'previous' results from axes.
Axes objects have a cla() method which clears their contents. In pylab, I believe the function cla() clears the current axes.
* Previously I've been using gnuplot to create pngs, which I can then form into a time series, mostly just plotting the data as a 'matrix'. While I take it for granted that python/matplotlib are loading/plotting the data in 'real-time' compared to just flicking between gnuplot-generated png's, pcolor is rather slow for me, and I'm unsure exactly what the other approaches (eg. imshow?) are targeted towards, or when they are appropriate compared to pcolor.
pcolor() does a lot of work under the hood to plot things the way it does. imshow() gives you a pseudocolor plot that treats the elements of the matrix as luminescence, which may be exactly what you want. Check out the "pcolor_demo.py" example (which actually uses imshow()!):
However, not only is pcolor slow, but for some reason it defaults to automatically selecting a different (overly large) automatic axis-range than contour[f].
It's my understanding that this behavior is by design: pcolor() treats each element Z[i,j] as being in between in between the corresponding X and Y elements (e.g. between X[i,j] and X[i+1,j]). I'm far from certain about this, so please take my answer with a grain of salt.
* Closing the pylab windows using the window-manager results in the python process continuing - should this be calling some function to interrupt the show() function? (I'm running GTK/GTKAgg if its relevant)
I'm a bit confused as to what behavior you are seeing. Does show() return so your script can resume executing when you close the pylab window, or does it never block in the first place?
Having said that, I'm not entirely clear whether pylab is intended to be 'the' interface to matplotlib, or just a simplified front-end - it seems quite confusing from reading some of the online documents.
iPython+pylab appears to be "the" interface to matplotlib for Matlab-style interactive plotting. Pylab on its own is pretty good for quick 'n dirty plotting from scripts (e.g. visualizing the results of some algorithm as you debug and refine it).
Matplotlib also has an object-oriented API that is much better to use when you are embedding matplotlib plots in other python applications. The OO API is "the" interface to matplotlib in that it *is* matplotlib... pylab is a wrapper that manages a lot of details to make things more convenient.
On Dec 8, 2005, at 6:55 PM, Neil Pilgrim wrote: