Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 72bf2d4

Browse files
committed
Update backend_nbagg for removal of Gcf._activeQue.
Looks like nbagg was (ab)using _activeQue to have "pyplot-managed figures that can never be gcf()" (not really sure why? this was here ever since nbagg was first merged in). Now that _activeQue has been merged into figs this is no longer possible, but I *guess* the patch is the closest in semantics?
1 parent 4616f70 commit 72bf2d4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/matplotlib/backends/backend_nbagg.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def connection_info():
3939
for manager in Gcf.get_all_fig_managers()
4040
]
4141
if not is_interactive():
42-
result.append('Figures pending show: {}'.format(len(Gcf._activeQue)))
42+
result.append(f'Figures pending show: {len(Gcf.figs)}')
4343
return '\n'.join(result)
4444

4545

@@ -266,5 +266,5 @@ def show(*args, block=None, **kwargs):
266266
if hasattr(manager, '_cidgcf'):
267267
manager.canvas.mpl_disconnect(manager._cidgcf)
268268

269-
if not interactive and manager in Gcf._activeQue:
270-
Gcf._activeQue.remove(manager)
269+
if not interactive:
270+
Gcf.figs.pop(manager.num, None)

0 commit comments

Comments
 (0)