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
6 changes: 4 additions & 2 deletions lib/matplotlib/figure.py
Original file line number Diff line number Diff line change
Expand Up @@ -2108,8 +2108,10 @@ def __getstate__(self):
# The canvas cannot currently be pickled, but this has the benefit
# of meaning that a figure can be detached from one canvas, and
# re-attached to another.
for attr_to_pop in ('canvas', '_cachedRenderer'):
state.pop(attr_to_pop, None)
state.pop("canvas")

# Set cached renderer to None -- it can't be pickled.
state["_cachedRenderer"] = None

# add version information to the state
state['__mpl_version__'] = _mpl_version
Expand Down