How do I tell matplotlib that I am done with a plot?
You can use figure
to create a new plot, for example, or use close
after the first plot.
There is a clear figure command, and it should do it for you:
plt.clf()
If you have multiple subplots in the same figure
plt.cla()
clears the current axes.