You could use the figure's clf method to clear the figure after you're done with one. Also, pyplot.clf will clear the current figure.
Alternatively, if you just want a new figure then call pyplot.figure without an explicit num
argument -- it will autoincrement, so you don't need to keep a counter.
ars
2010-07-12 00:06:39