I am writing a quick-and-dirty script to generate plots on the fly. I am using the code below (from Matplotlib documentation) as a starting point:
from pylab
You can do it like this:
def plotAFig(): plt.figure() plt.plot(x,y,'b-') plt.savefig("figurename.png") plt.close()