Skip to content

Commit 0c5ff18

Browse files
committed
Add activate_matplotlib() to _enable_matplotlib_integration()
refs ipython/ipykernel#247
1 parent 8c3fd5e commit 0c5ff18

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

backend_inline.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,12 +150,14 @@ def _enable_matplotlib_integration():
150150
ip = get_ipython()
151151
backend = get_backend()
152152
if ip and backend == 'module://%s' % __name__:
153-
from IPython.core.pylabtools import configure_inline_support
153+
from IPython.core.pylabtools import configure_inline_support, activate_matplotlib
154154
try:
155+
activate_matplotlib(backend)
155156
configure_inline_support(ip, backend)
156-
except ImportError:
157+
except (ImportError, AttributeError):
157158
# bugs may cause a circular import on Python 2
158159
def configure_once(*args):
160+
activate_matplotlib(backend)
159161
configure_inline_support(ip, backend)
160162
ip.events.unregister('post_run_cell', configure_once)
161163
ip.events.register('post_run_cell', configure_once)

0 commit comments

Comments
 (0)