diff --git a/IPython/zmq/pylab/backend_inline.py b/IPython/zmq/pylab/backend_inline.py index 469d74ca9cb..ddad82c8230 100644 --- a/IPython/zmq/pylab/backend_inline.py +++ b/IPython/zmq/pylab/backend_inline.py @@ -15,6 +15,7 @@ # Local imports. from IPython.config.configurable import SingletonConfigurable +from IPython.core.display import display from IPython.core.displaypub import publish_display_data from IPython.core.pylabtools import print_figure, select_figure_format from IPython.utils.traitlets import Dict, Instance, CaselessStrEnum, CBool @@ -102,7 +103,7 @@ def show(close=None): close = InlineBackend.instance().close_figures try: for figure_manager in Gcf.get_all_fig_managers(): - send_figure(figure_manager.canvas.figure) + display(figure_manager.canvas.figure) finally: show._to_draw = [] if close: @@ -138,7 +139,7 @@ def draw_if_interactive(): if not hasattr(fig, 'show'): # Queue up `fig` for display - fig.show = lambda *a: send_figure(fig) + fig.show = lambda *a: display(fig) # If matplotlib was manually set to non-interactive mode, this function # should be a no-op (otherwise we'll generate duplicate plots, since a user @@ -191,7 +192,7 @@ def flush_figures(): active = set([fm.canvas.figure for fm in Gcf.get_all_fig_managers()]) for fig in [ fig for fig in show._to_draw if fig in active ]: try: - send_figure(fig) + display(fig) except Exception as e: # safely show traceback if in IPython, else raise try: