Код: Выделить всё
import pickle
import matplotlib.pyplot as plt
fig, ax = plt.subplots()
ax.plot([1,2,3],[10,-10,30])
pickle.dump(fig, open('fig.pickle', 'wb'))
Код: Выделить всё
import pickle
figx = pickle.load(open('fig.pickle', 'rb'))
figx.show()
Код: Выделить всё
AttributeError: 'NoneType' object has no attribute 'manager'
Figure.show works only for figures managed by pyplot, normally created by pyplot.figure().
Код: Выделить всё
> import matplotlib
> matplotlib.__version__
'2.1.0'
> matplotlib.get_backend()
'Qt5Agg'
> import sys
> sys.version_info
sys.version_info(major=3, minor=6, micro=3, releaselevel='final', serial=0)
Подробнее здесь: https://stackoverflow.com/questions/495 ... lib-figure