AttributeError: 'AxesSubplot' object has no attribute 'savefig'错误解决方法

子图没有'savefig'这个方法

可以利用 matplotlib.pyplot 中的 gcf() 方法(get current figure)获得当前的figure:

fig = plt.gcf()
fig.savefig('output.png')

 

posted @ 2020-04-08 15:02  Ech2o  阅读(11269)  评论(0编辑  收藏  举报