Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 5 additions & 8 deletions lib/matplotlib/figure.py
Original file line number Diff line number Diff line change
Expand Up @@ -1858,14 +1858,11 @@ def __getstate__(self):
# add version information to the state
state['__mpl_version__'] = _mpl_version

# check to see if the figure has a manager and whether it is registered
# with pyplot
if getattr(self.canvas, 'manager', None) is not None:
manager = self.canvas.manager
import matplotlib._pylab_helpers
if manager in list(six.itervalues(
matplotlib._pylab_helpers.Gcf.figs)):
state['_restore_to_pylab'] = True
# check whether the figure manager (if any) is registered with pyplot
from matplotlib import _pylab_helpers
if getattr(self.canvas, 'manager', None) \
in _pylab_helpers.Gcf.figs.values():
state['_restore_to_pylab'] = True

# set all the layoutbox information to None. kiwisolver objects can't
# be pickled, so we lose the layout options at this point.
Expand Down