取消酸洗图给出AttributeError:'Figure'对象没有属性'stale_callback'

时间:2019-05-06 00:10:55

标签: python matplotlib pickle

我腌了matplotlib图

with open(save_to, 'wb') as file:
    pickle.dump(fig, file)

并尝试将其解开

with open(save_to,'rb') as fid:
    ax = pickle.load(fid)
    plt.show()

with open(save_to,'rb') as fid:
    ax = pickle.load(fid)
    ax.show()

但是我得到了错误

AttributeError: 'Figure' object has no attribute 'stale_callback'

原因是什么?

代码取自https://scikit-learn.org/stable/auto_examples/model_selection/plot_roc.html

我在这里而不是plt.show()腌制。

谢谢!

0 个答案:

没有答案