From 4988471ad462d8dd46145fb4d60dd1bcbe3e494c Mon Sep 17 00:00:00 2001 From: Pranav Raghu <73378019+Impaler343@users.noreply.github.com> Date: Mon, 4 Mar 2024 06:34:38 +0000 Subject: [PATCH 1/2] Added patch for Issue #18985 using tacaswell's suggestion --- lib/matplotlib/axes/_base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From b9b30fc8b4874c00f2972d7a75965f268d1482ab Mon Sep 17 00:00:00 2001 From: Pranav Raghu <73378019+Impaler343@users.noreply.github.com> Date: Mon, 4 Mar 2024 06:53:12 +0000 Subject: [PATCH 2/2] Added test for Issue #18985 --- lib/matplotlib/tests/test_axes.py | 7 +++++++ 1 file changed, 7 insertions(+) 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)