| 1 | initial version |
(referencing @kcrisman 's answer) I think it is maybe better not to import pylab into the global namespace, so just import pylab. To reset the plot, so to speak, you should call pylab.close() (or just close() if you import *) like this:
import pylab
pylab.imshow([[1,0],[0,1]])
pylab.savefig('plot1.png')
pylab.close()
pylab.imshow([[1,2],[0,1]])
pylab.savefig('plot2.png')
Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.