Show More
@@ -353,7 +353,7 b' def configure_inline_support(shell, backend):' | |||||
353 |
|
353 | |||
354 | if backend == backends['inline']: |
|
354 | if backend == backends['inline']: | |
355 | from IPython.kernel.zmq.pylab.backend_inline import flush_figures |
|
355 | from IPython.kernel.zmq.pylab.backend_inline import flush_figures | |
356 |
shell.register |
|
356 | shell.events.register('post_execute', flush_figures) | |
357 |
|
357 | |||
358 | # Save rcParams that will be overwrittern |
|
358 | # Save rcParams that will be overwrittern | |
359 | shell._saved_rcParams = dict() |
|
359 | shell._saved_rcParams = dict() | |
@@ -363,8 +363,10 b' def configure_inline_support(shell, backend):' | |||||
363 | pyplot.rcParams.update(cfg.rc) |
|
363 | pyplot.rcParams.update(cfg.rc) | |
364 | else: |
|
364 | else: | |
365 | from IPython.kernel.zmq.pylab.backend_inline import flush_figures |
|
365 | from IPython.kernel.zmq.pylab.backend_inline import flush_figures | |
366 | if flush_figures in shell._post_execute: |
|
366 | try: | |
367 |
shell. |
|
367 | shell.events.unregister('post_execute', flush_figures) | |
|
368 | except ValueError: | |||
|
369 | pass | |||
368 | if hasattr(shell, '_saved_rcParams'): |
|
370 | if hasattr(shell, '_saved_rcParams'): | |
369 | pyplot.rcParams.update(shell._saved_rcParams) |
|
371 | pyplot.rcParams.update(shell._saved_rcParams) | |
370 | del shell._saved_rcParams |
|
372 | del shell._saved_rcParams |
General Comments 0
You need to be logged in to leave comments.
Login now