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

Commitc96629f

Browse files
committed
Quick fix to figure for safe unpickling.
1 parentbd81fc0 commitc96629f

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

‎lib/matplotlib/figure.py‎

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1358,11 +1358,18 @@ def __setstate__(self, state):
13581358

13591359
ifrestore_to_pylab:
13601360
# lazy import to avoid circularity
1361+
# XXX clean on removal of Gcf from backends
13611362
importmatplotlib.pyplotasplt
13621363
importmatplotlib._pylab_helpersaspylab_helpers
1364+
importmatplotlib.backend_managersasmanagers
13631365
allnums=plt.get_fignums()
13641366
num=max(allnums)+1ifallnumselse1
1365-
mgr=plt._backend_mod.new_figure_manager_given_figure(num,self)
1367+
ifmanagers.old_new_figure_manager:
1368+
mgr=plt._backend_mod.new_figure_manager_given_figure(num,
1369+
self)
1370+
mgr.mainloop=plt._show
1371+
else:
1372+
mgr=managers.new_figure_manager_given_figure(num,self)
13661373

13671374
# XXX The following is a copy and paste from pyplot. Consider
13681375
# factoring to pylab_helpers
@@ -1377,7 +1384,7 @@ def make_active(event):
13771384
mgr._cidgcf=mgr.canvas.mpl_connect('button_press_event',
13781385
make_active)
13791386

1380-
pylab_helpers.Gcf.set_active(mgr)
1387+
pylab_helpers.Gcf.add_figure_manager(mgr)
13811388
self.number=num
13821389

13831390
plt.draw_if_interactive()

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp