(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