Skip to content

Commit d405b1c

Browse files
committed
Fix for issue #13478:
In an animation using blitting that contains some static graphics elements, the static parts of the figure are not updated after an interactive zoom/pan event. However, they are correctly updated after an resize event.
1 parent 1d7494f commit d405b1c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lib/matplotlib/animation.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1222,6 +1222,14 @@ def _setup_blit(self):
12221222
# axes
12231223
self._blit_cache = dict()
12241224
self._drawn_artists = []
1225+
def remove_from_cache(ax):
1226+
try:
1227+
del self._blit_cache[ax]
1228+
except KeyError:
1229+
pass
1230+
for ax in self._fig.axes:
1231+
ax.callbacks.connect('xlim_changed', remove_from_cache)
1232+
ax.callbacks.connect('ylim_changed', remove_from_cache)
12251233
self._resize_id = self._fig.canvas.mpl_connect('resize_event',
12261234
self._handle_resize)
12271235
self._post_draw(None, self._blit)

0 commit comments

Comments
 (0)