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

Skip to content

Commit f1c9d78

Browse files
committed
MNT: suppress pending figure count in interactive
In interactive mode the number of pending figures will always be equal to the number of open figures. Only include this count in `connection_info` in non-interactive mode.
1 parent 436dfdb commit f1c9d78

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/matplotlib/backends/backend_nbagg.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,10 @@ def connection_info():
7878
for manager in Gcf.get_all_fig_managers():
7979
fig = manager.canvas.figure
8080
result.append('{0} - {0}'.format((fig.get_label() or
81-
"Figure {0}".format(manager.num)),
82-
manager.web_sockets))
83-
result.append('Figures pending show: {0}'.format(len(Gcf._activeQue)))
81+
"Figure {0}".format(manager.num)),
82+
manager.web_sockets))
83+
if not is_interactive():
84+
result.append('Figures pending show: {0}'.format(len(Gcf._activeQue)))
8485
return '\n'.join(result)
8586

8687

0 commit comments

Comments
 (0)