Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitdd8bb2d

Browse files
authored
Merge pull request#17705 from anntzer/uncache-renderer
FIX: Keep cachedRenderer as None when pickling Figure.
2 parents089b61f +583e1d9 commitdd8bb2d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

‎lib/matplotlib/figure.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2108,8 +2108,10 @@ def __getstate__(self):
21082108
# The canvas cannot currently be pickled, but this has the benefit
21092109
# of meaning that a figure can be detached from one canvas, and
21102110
# re-attached to another.
2111-
forattr_to_popin ('canvas','_cachedRenderer'):
2112-
state.pop(attr_to_pop,None)
2111+
state.pop("canvas")
2112+
2113+
# Set cached renderer to None -- it can't be pickled.
2114+
state["_cachedRenderer"]=None
21132115

21142116
# add version information to the state
21152117
state['__mpl_version__']=_mpl_version

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp