diff --git a/lib/matplotlib/axes/_base.py b/lib/matplotlib/axes/_base.py index 0617fc7681bd..9df73aa9902f 100644 --- a/lib/matplotlib/axes/_base.py +++ b/lib/matplotlib/axes/_base.py @@ -3073,7 +3073,7 @@ def draw(self, renderer): if not self.figure.canvas.is_saving(): artists = [ a for a in artists - if not a.get_animated() or isinstance(a, mimage.AxesImage)] + if not a.get_animated()] artists = sorted(artists, key=attrgetter('zorder')) # rasterize artists with negative zorder diff --git a/lib/matplotlib/tests/test_axes.py b/lib/matplotlib/tests/test_axes.py index 8c43b04e0eb7..394359d1b6ce 100644 --- a/lib/matplotlib/tests/test_axes.py +++ b/lib/matplotlib/tests/test_axes.py @@ -8914,3 +8914,10 @@ def test_axhvlinespan_interpolation(): ax.axhline(1, c="C0", alpha=.5) ax.axhspan(.8, .9, fc="C1", alpha=.5) ax.axhspan(.6, .7, .8, .9, fc="C2", alpha=.5) + + +@check_figures_equal(extensions=["png"]) +def test_anim_without_image(fig_test, fig_ref): + ax_ref = fig_ref.subplots() + imdata = np.random.random((20, 20)) + ax_ref.plot(imdata, animated=True)