I am trying to generate different figures with matplotlib
:
import matplotlib.pyplot as plt
for item in item_list:
plt.imshow(item)
plt.grid(True)
# generate id
plt.savefig(filename + id)
plt.close()
The loop does generate a number of files but they seem to show the superposition of different figures, whereas, if I plot the items one by one they look very different.
How do I make sure each item is plotted independently and saved to file?