I wanted to plot n independent figures by a for loop, with each figure saved to one file. My code is as following:
import matplotlib.pyplot as plt import num
At the beginning of your loop, add:
plt.close()