Skip to content

Fix incorrect window_extent of AxesImage #24556

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

Merged
merged 2 commits into from
Nov 30, 2022

Conversation

leejjoon
Copy link
Contributor

PR Summary

AxesImage can take a transform parameter. However, AxesImage.get_window_extent does not respect its value and simply use the hardcoded value of transData (the draw method does respect the transform parameter).
The PR makes the get_window_extent method to use the return value of get_transfrom.

PR Checklist

Documentation and Tests

  • [N/A] Has pytest style unit tests (and pytest passes)
  • [N/A] Documentation is sphinx and numpydoc compliant (the docs should build without error).
  • [N/A] New plotting related features are documented with examples.

Release Notes

  • [N/A] New features are marked with a .. versionadded:: directive in the docstring and documented in doc/users/next_whats_new/
  • [N/A] API changes are marked with a .. versionchanged:: directive in the docstring and documented in doc/api/next_api_changes/
  • [N/A] Release notes conform with instructions in next_whats_new/README.rst or next_api_changes/README.rst

@oscargus
Copy link
Member

Would be good to have a test to make sure that this is not broken later.

@tacaswell tacaswell added this to the v3.7.0 milestone Nov 28, 2022
@tacaswell
Copy link
Member

👍🏻 to this fix and to the request for a test.

@leejjoon leejjoon force-pushed the fix-axesimage-window-extent branch from c5294cf to 50218d1 Compare November 30, 2022 12:56
@leejjoon
Copy link
Contributor Author

I have added a simple test in test_image.py::test_get_window_extent_for_AxisImage. The test is only for transAxes.
Any suggestion for other tests?

Copy link
Member

@oscargus oscargus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There may be more tests, but I think that this is enough (and/or I do not really know what else to test...).

@tacaswell tacaswell merged commit 9b7c902 into matplotlib:main Nov 30, 2022
@leejjoon leejjoon deleted the fix-axesimage-window-extent branch December 8, 2022 09:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants