Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Fixes unwanted plotting of Images in animated mode #27853

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
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
2 changes: 1 addition & 1 deletion lib/matplotlib/axes/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 7 additions & 0 deletions lib/matplotlib/tests/test_axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)