Show More
@@ -15,6 +15,7 b' from matplotlib._pylab_helpers import Gcf' | |||
|
15 | 15 | |
|
16 | 16 | # Local imports. |
|
17 | 17 | from IPython.config.configurable import SingletonConfigurable |
|
18 | from IPython.core.display import display | |
|
18 | 19 | from IPython.core.displaypub import publish_display_data |
|
19 | 20 | from IPython.core.pylabtools import print_figure, select_figure_format |
|
20 | 21 | from IPython.utils.traitlets import Dict, Instance, CaselessStrEnum, CBool |
@@ -102,7 +103,7 b' def show(close=None):' | |||
|
102 | 103 | close = InlineBackend.instance().close_figures |
|
103 | 104 | try: |
|
104 | 105 | for figure_manager in Gcf.get_all_fig_managers(): |
|
105 |
|
|
|
106 | display(figure_manager.canvas.figure) | |
|
106 | 107 | finally: |
|
107 | 108 | show._to_draw = [] |
|
108 | 109 | if close: |
@@ -138,7 +139,7 b' def draw_if_interactive():' | |||
|
138 | 139 | |
|
139 | 140 | if not hasattr(fig, 'show'): |
|
140 | 141 | # Queue up `fig` for display |
|
141 |
fig.show = lambda *a: |
|
|
142 | fig.show = lambda *a: display(fig) | |
|
142 | 143 | |
|
143 | 144 | # If matplotlib was manually set to non-interactive mode, this function |
|
144 | 145 | # should be a no-op (otherwise we'll generate duplicate plots, since a user |
@@ -191,7 +192,7 b' def flush_figures():' | |||
|
191 | 192 | active = set([fm.canvas.figure for fm in Gcf.get_all_fig_managers()]) |
|
192 | 193 | for fig in [ fig for fig in show._to_draw if fig in active ]: |
|
193 | 194 | try: |
|
194 |
|
|
|
195 | display(fig) | |
|
195 | 196 | except Exception as e: |
|
196 | 197 | # safely show traceback if in IPython, else raise |
|
197 | 198 | try: |
General Comments 0
You need to be logged in to leave comments.
Login now