Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Fix mplot3d projection#16472
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
Merged
Fix mplot3d projection#16472
Uh oh!
There was an error while loading.Please reload this page.
Conversation
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
Fixesmatplotlibgh-8894, by always using a "position" that maintains a uniform coordinate system.Test added - when viewed from above, the plot should be square not rhombic.
…ouslyThis sets it to have a 4:3 aspect ratio, which matches what would result from a typical figure layout
As requested in review feedback - since all the images changed, may as wellrestyle them.Note that this restyling caused a test to become platform-dependent on theanti-aliasing on the edges of a narrow line - presumably due to the resolutiondecrease making the line narrower - so a non-zero `tol` value was added.
8ffc57b
toce08435
Comparejklymak approved these changesFeb 11, 2020
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Seems to be passing!
anntzer approved these changesFeb 11, 2020
I'll wait for travis to pass too. |
travis failure is spurious. |
10 tasks
tacaswell added a commit to tacaswell/matplotlib that referenced this pull requestMay 27, 2020
To make bbox_inches='tight' work correctly, we cache the positions ofall of the axes, change their aspect to 'auto', adjust the transformson the figure, render the output, and then restore the previoussetting of aspect to each of the figures. This prevent the Axes fromtrying to adjust their size on draw. This matters because for therender that is emitted the figure transforms are out of sync with thefigure size.As part of cleaning fixing the rendering of Axes3D inmatplotlib#8896 /matplotlib#16472we started to use apply_aspect to re-size the area the Axes3D takes upto maintain a fixed ratio between the axes when the aspect is "auto".However this conflicts with the expectation in tight_bbox.adjust_bboxas it assumes setting the aspect to "auto" will prevent any axesresizing.This commit addresses this by: - exiting the Axes3D.apply_aspect early if aspect is auto - adding a new aspect mode 'auto_pb' which is the default for Axes3D which maintains the current master branch behavior of maintaining a fixed ratio between the sizes of the x, y z axis independent of the data limits. - re implement several functions on Axes3D to make sure they handle sharez correctly.closesmatplotlib#16463.
6 tasks
tacaswell added a commit to tacaswell/matplotlib that referenced this pull requestMay 30, 2020
The way that bbox_inches='tight' is implemented we need to ensure thatwe do not try to adjust the aspect during the draw (because we havetemporarily de-coupled the reported figure size from the transformswhich results in the being distorted). Previously we did not have away to fix the aspect ratio in screen space of the Axes (only theaspect ratio in dataspace) however in 3.3 we gained this ability forboth Axes (matplotlib#14917) and Axes3D (matplotlib#8896 /matplotlib#16472).Rather than add an aspect value to `set_aspect` to handle this case,in the tight_bbox code we monkey-patch the `apply_aspect` method witha no-op function and then restore it when we are done. Previously wewould set the aspect to "auto" and restore it in the same places.closesmatplotlib#16463.
tacaswell added a commit to tacaswell/matplotlib that referenced this pull requestJun 4, 2020
The way that bbox_inches='tight' is implemented we need to ensure thatwe do not try to adjust the aspect during the draw (because we havetemporarily de-coupled the reported figure size from the transformswhich results in the being distorted). Previously we did not have away to fix the aspect ratio in screen space of the Axes (only theaspect ratio in dataspace) however in 3.3 we gained this ability forboth Axes (matplotlib#14917) and Axes3D (matplotlib#8896 /matplotlib#16472).Rather than add an aspect value to `set_aspect` to handle this case,in the tight_bbox code we monkey-patch the `apply_aspect` method witha no-op function and then restore it when we are done. Previously wewould set the aspect to "auto" and restore it in the same places.closesmatplotlib#16463.
Sign up for freeto 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.
Redo ofgh-8896, which was force-pushed out of the history.
There is now only a single commit with image updates.
It is likely that the images are wrong, because my machine does not produce CI-compatible images.