We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 2199e3e + f7ea2b3 commit aa13340Copy full SHA for aa13340
lib/matplotlib/figure.py
@@ -2108,8 +2108,10 @@ def __getstate__(self):
2108
# The canvas cannot currently be pickled, but this has the benefit
2109
# of meaning that a figure can be detached from one canvas, and
2110
# re-attached to another.
2111
- for attr_to_pop in ('canvas', '_cachedRenderer'):
2112
- state.pop(attr_to_pop, None)
+ state.pop("canvas")
+
2113
+ # Set cached renderer to None -- it can't be pickled.
2114
+ state["_cachedRenderer"] = None
2115
2116
# add version information to the state
2117
state['__mpl_version__'] = _mpl_version
0 commit comments