Added get_shape method
PR Summary
Added get_shape method and updated __str__ to AxesImage as specified by (#22494)
PR Checklist
Tests and Styling
- [x] Has pytest style unit tests (and
pytestpasses). - [x] Is Flake 8 compliant (install
flake8-docstringsand runflake8 --docstring-convention=all).
Documentation
- [N/A ] New features are documented, with examples if plot related.
- [N/A] New features have an entry in
doc/users/next_whats_new/(follow instructions in README.rst there). - [x] API changes documented in
doc/api/next_api_changes/(follow instructions in README.rst there). - [x] Documentation is sphinx and numpydoc compliant (the docs should build without error).
Please add tests for these changes.
You can example generate a test image as:
ax = plt.gca()
im = AxesImage(ax)
z = np.arange(12, dtype=float).reshape((4, 3))
im.set_data(z)
and then call the methods (in separate tests) and add an assert for the expected results. Add these tests to https://github.com/matplotlib/matplotlib/blob/main/lib/matplotlib/tests/test_image.py
Please do not merge the main branch into your feature branch (we prefer to rebase if there are conflicts).
@Lumijek are you still planning to continue on this? If not, I'd pick this up so that it can move forward.
Moved to draft until someone picks this up.
It's been a while so I can write some tests for this. I don't know what the procedure is for picking up orphaned PRs though.
Thanks @saranti, basically just create a new branch and a new PR referencing this one. You could git cherry-pick the relevant commit from here into your branch, or just write your new branch from scratch, whichever you prefer.
Closing in favor of #25425