From 2a2b90ed3fe7e0cf2e56bd6c1bb798758b6f4d4b 2016-03-02 02:30:04 From: Thomas A Caswell Date: 2016-03-02 02:30:04 Subject: [PATCH] FIX: use mpl.get_backend() instead of a global Use `matplotlib.get_backend()` to look up the current backend rather than looking at a module-level golabl in `matplotlib.backends`. Closes #9286 --- diff --git a/IPython/core/pylabtools.py b/IPython/core/pylabtools.py index 6528178..a4a8450 100644 --- a/IPython/core/pylabtools.py +++ b/IPython/core/pylabtools.py @@ -211,7 +211,7 @@ def select_figure_formats(shell, formats, **kwargs): [ f.pop(Figure, None) for f in shell.display_formatter.formatters.values() ] - if matplotlib.backends.backend.lower() == 'nbagg': + if matplotlib.get_backend().lower() == 'nbagg': formatter = shell.display_formatter.ipython_display_formatter formatter.for_type(Figure, _reshow_nbagg_figure)