Python 属性错误:';模块';对象没有属性';保存';-matplotlib

Python 属性错误:';模块';对象没有属性';保存';-matplotlib,python,matplotlib,Python,Matplotlib,当我尝试使用matplotlib(plt.save('static/chart.png')保存绘图时,会出现此错误。我肯定进口有问题,但我不确定具体是什么问题。这些是我使用的导入: import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt matplotlib.pyplot中没有save功能。ׁ也许您想使用savefig?如果您使用plt.savefig('static/chart.png')呢?

当我尝试使用matplotlib(plt.save('static/chart.png')保存绘图时,会出现此错误。我肯定进口有问题,但我不确定具体是什么问题。这些是我使用的导入:

import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt

matplotlib.pyplot
中没有
save
功能。ׁ也许您想使用
savefig

如果您使用
plt.savefig('static/chart.png')
呢?