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

Skip to content

Commit bce5b8d

Browse files
committed
Merged revisions 8557 via svnmerge from
https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/branches/v1_0_maint ........ r8557 | efiring | 2010-07-15 10:45:19 -1000 (Thu, 15 Jul 2010) | 3 lines show for tkagg doesn't block in script called via ipython -pylab. This is the first in an expected series of changes to show(). ........ svn path=/trunk/matplotlib/; revision=8558
1 parent 3225105 commit bce5b8d

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

lib/matplotlib/backends/backend_tkagg.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,13 @@ def show():
7171
"""
7272
for manager in Gcf.get_all_fig_managers():
7373
manager.show()
74-
Tk.mainloop()
74+
try:
75+
if not show._needmain: # might have been added by ipython
76+
return
77+
except AttributeError:
78+
pass
79+
if not matplotlib.is_interactive():
80+
Tk.mainloop()
7581

7682
def new_figure_manager(num, *args, **kwargs):
7783
"""

0 commit comments

Comments
 (0)