Skip to content

Commit 6e42a75

Browse files
author
ojeda-e
committed
Added __setstate__ in Text to pickle weakref
1 parent 1168d75 commit 6e42a75

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/matplotlib/text.py

+5
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,13 @@ def __getstate__(self):
177177
d = super().__getstate__()
178178
# remove the cached _renderer (if it exists)
179179
d['_renderer'] = None
180+
d['_cached'] = None
180181
return d
181182

183+
def __setstate__(self, state):
184+
self.__dict__.update(state)
185+
self._cached = cbook.maxdict(50)
186+
182187
def contains(self, mouseevent):
183188
"""
184189
Return whether the mouse event occurred inside the axis-aligned

0 commit comments

Comments
 (0)