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

子图没有'savefig'这个方法

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

fig = plt.gcf()
fig.savefig('output.png')
原文地址:https://www.cnblogs.com/ech2o/p/12660007.html