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

Skip to content

Commit bc65530

Browse files
committed
MNT: simplify and be explicit about what GUI to setup
1 parent dc2402d commit bc65530

File tree

1 file changed

+2
-14
lines changed

1 file changed

+2
-14
lines changed

lib/matplotlib/backend_bases.py

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1659,20 +1659,8 @@ def _fix_ipython_backend2gui(cls):
16591659
backend2gui_rif = {"qt5": "qt", "qt4": "qt", "gtk3": "gtk3",
16601660
"wx": "wx", "macosx": "osx"}.get(rif)
16611661
if backend2gui_rif:
1662-
pt.backend2gui[get_backend()] = backend2gui_rif
1663-
# Work around pylabtools.find_gui_and_backend always reading from
1664-
# rcParamsOrig.
1665-
orig_origbackend = mpl.rcParamsOrig["backend"]
1666-
1667-
try:
1668-
mpl.rcParamsOrig["backend"] = mpl.rcParams["backend"]
1669-
if _is_non_interactive_terminal_ipython(ip):
1670-
pass
1671-
else:
1672-
ip.enable_gui()
1673-
1674-
finally:
1675-
mpl.rcParamsOrig["backend"] = orig_origbackend
1662+
if _is_non_interactive_terminal_ipython(ip):
1663+
ip.enable_gui(backend2gui_rif)
16761664

16771665
@contextmanager
16781666
def _idle_draw_cntx(self):

0 commit comments

Comments
 (0)