MNT: Commonize 3D zmargin handling with x and y axes#31287
Open
scottshambaugh wants to merge 2 commits intomatplotlib:mainfrom
Open
MNT: Commonize 3D zmargin handling with x and y axes#31287scottshambaugh wants to merge 2 commits intomatplotlib:mainfrom
scottshambaugh wants to merge 2 commits intomatplotlib:mainfrom
Conversation
ac5e4d3 to
b4732a8
Compare
scottshambaugh
commented
Mar 12, 2026
a12522b to
f01afb5
Compare
Member
|
I'm pretty sure many of these tests that are changed here have a "Remove this line when the image is regenerated." comment in them that should be heeded. |
da629d1 to
4a261f9
Compare
4a261f9 to
a12357a
Compare
Contributor
Author
|
Good catch, took those off of the 5 that had it. Also took off the tolerance on one, I'll see if it needs to be added back after cross-platform CI. Edit: looks good |
Member
|
I haven't checked, but I'm not sure if some of these changes will conflict with the text overhaul branch? I guess we need some decision on some of the questions in the original post though. |
Contributor
Author
|
Some images will need to be regenerated but I don't see the code changes conflicting with text edits. To summarize, the choice that needs to be made is between these. (1) is what's in right now, but I don't care too much either way:
|
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.
PR summary
Closes #31213
The 3D z axis margin was handled inconsistently from the x and y axes, leading to special casing and inconsistent visual results even with equal values for the
axes.[x/y/z]marginrcparams. I put this change somewhere between maintenance and a bugfix.This requires regenerating a good number of baseline images (about half of 3d images), but I don't see a good way around that.
If people don't like the results being "squished" then the right way to handle this would be to keep these changes and set
axes.zmargin = 0in the rcparams (scatter plots and nonlinear scales would still change appearance). There's some justification for this because the x:y:z aspect ratio is 4:4:3 by default, so that would be "unsquishing" in a way. But this is always controllable by the user viaset_box_aspectand axis limits. I don't feel too strongly either way.AI Disclosure
PR checklist