From 7bca3522e82ed5558e42826746ab6ffe666c8c8e 2016-10-12 01:15:01 From: Thomas A Caswell Date: 2016-10-12 01:15:01 Subject: [PATCH] MNT: add hook for mpl > 1.5 This will properly handle > 1 figure being updated in `%run` --- diff --git a/IPython/core/pylabtools.py b/IPython/core/pylabtools.py index 3a8bf2e..35ff07b 100644 --- a/IPython/core/pylabtools.py +++ b/IPython/core/pylabtools.py @@ -172,6 +172,13 @@ def mpl_runner(safe_execfile): plt.draw() plt.draw_if_interactive.called = False + # re-draw everything that is stale + try: + da = plt.draw_all + except AttributeError: + pass + else: + da() return mpl_execfile