I am trying to use a forloop to produce figures for each set of data I have, but while the .show() command produces the correct figure, .savefig() keeps adding the previous
You have to close current figure after saving with function plt.close(): http://matplotlib.org/api/pyplot_api.html#matplotlib.pyplot.close
plt.close()
Or you have to clean current figure after saving by plt.clf(): http://matplotlib.org/api/pyplot_api.html#matplotlib.pyplot.clf
plt.clf()