Title: FIX: Respect animated=True for AxesImage by saumyacoder1709 · Pull Request #30823 · matplotlib/matplotlib · GitHub
Open Graph Title: FIX: Respect animated=True for AxesImage by saumyacoder1709 · Pull Request #30823 · matplotlib/matplotlib
X Title: FIX: Respect animated=True for AxesImage by saumyacoder1709 · Pull Request #30823 · matplotlib/matplotlib
Description: AxesImage was incorrectly being drawn even when animated=True due to an explicit exception in the artist filtering logic. Removed the special case for AxesImage so it respects the animated property like all other artists (Line2D, patches, etc). When animated=True, artists should only be drawn explicitly (e.g., during animation updates), not during normal rendering. Fixes #18985 PR summary Why is this change necessary? When using animated=True with imshow(), the image was still being rendered during interactive display, unlike other artists (lines, patches) which correctly remain invisible. This breaks the expected behavior of the animated property and makes animations inconsistent. What problem does it solve? The bug prevented proper use of animated=True with images in animation workflows. Users couldn't hide images from normal rendering like they could with other artists. Reproduction: import matplotlib.pyplot as plt import numpy as np fig, (ax1, ax2) = plt.subplots(ncols=2) im = ax1.imshow(np.random.random((20, 20)), animated=True) # Was visible (BUG) ln, = ax2.plot(np.random.random(20), animated=True) # Correctly invisible plt.show() # Expected: both blank. Actual: left showed image PR checklist "closes #18985" is in the body of the PR description to link the related issue [N/A] new and changed code is tested [N/A] Plotting related features are demonstrated in an example [N/A] New Features and API Changes are noted with a directive and release note Documentation complies with general and docstring guidelines
Open Graph Description: AxesImage was incorrectly being drawn even when animated=True due to an explicit exception in the artist filtering logic. Removed the special case for AxesImage so it respects the animated property...
X Description: AxesImage was incorrectly being drawn even when animated=True due to an explicit exception in the artist filtering logic. Removed the special case for AxesImage so it respects the animated property...
Opengraph URL: https://github.com/matplotlib/matplotlib/pull/30823
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:8832bc37-0b17-8b55-0cbf-58e69a2563fa |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | BFA2:272982:46D215:5C0512:6A52F61C |
| html-safe-nonce | 23e3246386a2100192a3aba27a46bb1e053213f532f2d582e7c555a0ed040950 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRkEyOjI3Mjk4Mjo0NkQyMTU6NUMwNTEyOjZBNTJGNjFDIiwidmlzaXRvcl9pZCI6Ijc1MjY2MTUzMzY4NTYyNTM5ODAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | d9cf5fa5b9156550a4c81a530eb48653210384e6248e686586eafddf9c3721e7 |
| hovercard-subject-tag | pull_request:3082107234 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/matplotlib/matplotlib/pull/30823/files |
| twitter:image | https://avatars.githubusercontent.com/u/145997182?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/145997182?s=400&v=4 |
| og:image:alt | AxesImage was incorrectly being drawn even when animated=True due to an explicit exception in the artist filtering logic. Removed the special case for AxesImage so it respects the animated property... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/matplotlib/matplotlib git https://github.com/matplotlib/matplotlib.git |
| octolytics-dimension-user_id | 215947 |
| octolytics-dimension-user_login | matplotlib |
| octolytics-dimension-repository_id | 1385122 |
| octolytics-dimension-repository_nwo | matplotlib/matplotlib |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1385122 |
| octolytics-dimension-repository_network_root_nwo | matplotlib/matplotlib |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 07a982c1d40157c619b364352b704c3ce66bb332 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width