From aef16347602c5e2368aed38d7a0e8d21321606d7 Mon Sep 17 00:00:00 2001 From: Antony Lee Date: Fri, 27 May 2022 16:38:50 +0200 Subject: [PATCH] No longer call draw_if_interactive in parasite_axes. This is a remnant of the pre-staleness system, where all pyplot functions used to call draw_if_interactive to trigger a draw_idle; this has now been superseded with the stale system which likewise triggers a draw_idle (here via add_subplot, which marks the figure as stale). This way, the only remaining places that call draw_if_interactive internally are in plt.figure() and in figure unpickling. --- lib/mpl_toolkits/axes_grid1/parasite_axes.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/mpl_toolkits/axes_grid1/parasite_axes.py b/lib/mpl_toolkits/axes_grid1/parasite_axes.py index 389fd982de91..760c15fb8bb3 100644 --- a/lib/mpl_toolkits/axes_grid1/parasite_axes.py +++ b/lib/mpl_toolkits/axes_grid1/parasite_axes.py @@ -257,7 +257,6 @@ def host_axes(*args, axes_class=Axes, figure=None, **kwargs): figure = plt.gcf() ax = host_axes_class(figure, *args, **kwargs) figure.add_axes(ax) - plt.draw_if_interactive() return ax @@ -280,5 +279,4 @@ def host_subplot(*args, axes_class=Axes, figure=None, **kwargs): figure = plt.gcf() ax = host_subplot_class(figure, *args, **kwargs) figure.add_subplot(ax) - plt.draw_if_interactive() return ax