Skip to content

Commit

Permalink
Call IPython.enable_gui when install repl displayhook
Browse files Browse the repository at this point in the history
  • Loading branch information
ianthomas23 committed Jun 3, 2024
1 parent 6221736 commit 1531850
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/matplotlib/pyplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,10 +304,12 @@ def install_repl_displayhook() -> None:
# This code can be removed when Python 3.12, the latest version supported by
# IPython < 8.24, reaches end-of-life in late 2028.
from IPython.core.pylabtools import backend2gui
# trigger IPython's eventloop integration, if available
ipython_gui_name = backend2gui.get(get_backend())
if ipython_gui_name:
ip.enable_gui(ipython_gui_name)
else:
_, ipython_gui_name = backend_registry.resolve_backend(get_backend())
# trigger IPython's eventloop integration, if available
if ipython_gui_name:
ip.enable_gui(ipython_gui_name)


def uninstall_repl_displayhook() -> None:
Expand Down

0 comments on commit 1531850

Please sign in to comment.