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

Skip to content

Commit d66a760

Browse files
committed
FIX: preserve interactive state around ip.enable_matplotlib()
closes #14950
1 parent 4cde730 commit d66a760

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/matplotlib/backend_bases.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1669,7 +1669,12 @@ def _fix_ipython_backend2gui(cls):
16691669
if _is_non_interactive_terminal_ipython(ip):
16701670
pass
16711671
else:
1672-
ip.enable_matplotlib()
1672+
was_interacive = mpl.is_interactive()
1673+
try:
1674+
ip.enable_matplotlib()
1675+
finally:
1676+
mpl.interactive(was_interacive)
1677+
16731678
finally:
16741679
mpl.rcParamsOrig["backend"] = orig_origbackend
16751680

0 commit comments

Comments
 (0)