🌐 AI搜索 & 代理 主页
Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions lib/matplotlib/axes/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -3203,10 +3203,9 @@ def draw(self, renderer):
for _axis in self._axis_map.values():
artists.remove(_axis)

if not self.get_figure(root=True).canvas.is_saving():
artists = [
a for a in artists
if not a.get_animated() or isinstance(a, mimage.AxesImage)]
if not self.figure.canvas.is_saving():
artists = [a for a in artists if not a.get_animated()]

artists = sorted(artists, key=attrgetter('zorder'))

# rasterize artists with negative zorder
Expand Down
13 changes: 13 additions & 0 deletions lib/matplotlib/tests/test_imshow_animated.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
from matplotlib.testing.decorators import check_figures_equal
import numpy as np


@check_figures_equal()
def test_imshow_respects_animated(fig_test, fig_ref):
rng = np.random.default_rng(19680801)
data = rng.random((8, 8))

ax_t = fig_test.subplots()
ax_t.imshow(data, animated=True) # should be skipped on initial draw

fig_ref.subplots() # blank reference
Loading