You have to be a little careful here -- remember whenever you are
creating plots in a loop you should pair every figure command with a
close to avoid memory leaks
for i in somerange:
You have a few other alternatives.... The hold state affects whether
new plot commands to an Axes/Subplot will overwrite the existing one
or add on to it
scatter(mydata, ..., hold=False) # clear the existing axes
scatter(mydata, ..., hold=True) # add to the existing axes
See also the commands clf (clear current figure) and cla (clear
On Wed, 15 Mar 2006, Imara Jarrett wrote:
>> I would like to generate matplotlib scatter plots in a python
>> 'for' loop.
> Use 'figure'.