Fix restoring 'auto' aspect in 3D axes after switching from 'equal'#31304
Open
jayaprajapatii wants to merge 1 commit intomatplotlib:mainfrom
Open
Fix restoring 'auto' aspect in 3D axes after switching from 'equal'#31304jayaprajapatii wants to merge 1 commit intomatplotlib:mainfrom
jayaprajapatii wants to merge 1 commit intomatplotlib:mainfrom
Conversation
Member
|
I'm not too familiar with 3D plotting, but the test explicitly set the box aspect. If a user did similarly, shouldn't we respect it? matplotlib/lib/mpl_toolkits/mplot3d/tests/test_axes3d.py Lines 88 to 89 in 32805b1 |
Contributor
Author
|
Thanks @rcomer Would it make more sense to only reset the box aspect when it was implicitly modified by the equal-aspect logic, rather than when it was explicitly set by the user? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #31276
Switching the aspect of a 3D axis from
"auto"to"equal"and then back to"auto"did not restore the original plot correctly. The logic for handling"auto"continued executing the equal-aspect adjustments, which modified the axis limits and box aspect.This change ensures that when
aspect == "auto", the box aspect is reset and the function exits early, preventing further equal-aspect logic from running.The baseline image for
test_aspectshas been updated to reflect the corrected rendering.