グラフを画像で保存する

2011/2/2

Python2.5.4, matplotlib-0.98.5.2

import matplotlib.pyplot as plt

x = [1,2,3,4,5,6]
y = [2,5,4,6,8,7]
plt.plot(x,y)

filename = "output.png"
plt.savefig(filename)