from matplotlib import pyplot as plt
x=[2,5]
y=[4,9]
plt.plot(x,y)
plt.savefig('D:\img.jpg')
或者保存为pdf格式:
plt.savefig('D:\img.pdf')

更多推荐

图片保存路径更改 python