Wednesday 19 June 2013

save matplotlib pylab plots

import matplotlib.pyplot as plt

plt.plot(range(4))
plt.savefig("test.png", format='png')

and / or


a = subplot(221)
a.plot(range(4))
savefig('test2.png', format='png')

No comments:

Post a Comment