Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions IPython/core/pylabtools.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@
'nbagg': 'nbAgg',
'notebook': 'nbAgg',
'agg': 'agg',
'inline' : 'module://ipykernel.pylab.backend_inline'}
'inline': 'module://ipykernel.pylab.backend_inline',
'ipympl': 'module://ipympl.backend_nbagg',
}

# We also need a reverse backends2guis mapping that will properly choose which
# GUI support to activate based on the desired matplotlib backend. For the
Expand Down Expand Up @@ -221,8 +223,8 @@ def select_figure_formats(shell, formats, **kwargs):
formats = set(formats)

[ f.pop(Figure, None) for f in shell.display_formatter.formatters.values() ]

if matplotlib.get_backend().lower() == 'nbagg':
mplbackend = matplotlib.get_backend().lower()
if mplbackend == 'nbagg' or mplbackend == 'module://ipympl.backend_nbagg':
formatter = shell.display_formatter.ipython_display_formatter
formatter.for_type(Figure, _reshow_nbagg_figure)

Expand Down