Skip to content

Commit

Permalink
Backport PR matplotlib#28332: Call IPython.enable_gui when install re…
Browse files Browse the repository at this point in the history
…pl displayhook
  • Loading branch information
tacaswell authored and meeseeksmachine committed Jun 3, 2024
1 parent 91ff901 commit 75ac1bd
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 75ac1bd

Please sign in to comment.