Skip to content
Merged
Show file tree
Hide file tree
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: 6 additions & 0 deletions lib/matplotlib/tests/test_pickle.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,12 @@ def test_simple():
# recursive_pickle(ax, 'figure')
# pickle.dump(ax, BytesIO(), pickle.HIGHEST_PROTOCOL)

fig = plt.figure()
plt.plot(range(10))
fig.tight_layout(pad=0.3)
recursive_pickle(fig)
pickle.dump(fig, BytesIO(), pickle.HIGHEST_PROTOCOL)


@image_comparison(baseline_images=['multi_pickle'],
extensions=['png'], remove_text=True)
Expand Down
6 changes: 6 additions & 0 deletions lib/matplotlib/text.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,12 @@ def __init__(self,
self.update(kwargs)
#self.set_bbox(dict(pad=0))

def __getstate__(self):
d = super(Text, self).__getstate__()
# remove the cached _renderer (if it exists)
d['_renderer'] = None
return d

def contains(self, mouseevent):
"""Test whether the mouse event occurred in the patch.

Expand Down