Skip to content

BUG: Don't try to show / autoscale 3D data that lies outside the axis valid scale range#31737

Merged
ksunden merged 4 commits into
matplotlib:mainfrom
scottshambaugh:fix-31726-3d-scale-invalid
May 29, 2026
Merged

BUG: Don't try to show / autoscale 3D data that lies outside the axis valid scale range#31737
ksunden merged 4 commits into
matplotlib:mainfrom
scottshambaugh:fix-31726-3d-scale-invalid

Conversation

@scottshambaugh

@scottshambaugh scottshambaugh commented May 22, 2026

Copy link
Copy Markdown
Contributor

PR summary

Closes #31726

Marking for 3.11 as the 3D log behavior is new this version, but I'm not actually clear on the inclusion criteria for bugfixes during an rc cycle.

This keeps the current Scale.val_in_range behavior of returning bare True/False for non-iterable inputs, though that was introduced in 3.11 so could change that before it goes out. Not completely necessary to vectorize that function, but it will get called a lot so I expect performance this way to be better.

AI Disclosure

Claude did the first pass, I cleaned up it after.

PR checklist

@scottshambaugh scottshambaugh added this to the v3.11.0 milestone May 22, 2026
@scottshambaugh scottshambaugh added topic: mplot3d PR: bugfix Pull requests that fix identified bugs labels May 22, 2026
@scottshambaugh scottshambaugh force-pushed the fix-31726-3d-scale-invalid branch from 08f0bac to 629d396 Compare May 22, 2026 23:30
Comment thread lib/matplotlib/tests/test_scale.py Outdated
Comment thread lib/mpl_toolkits/mplot3d/art3d.py Outdated
Comment thread lib/mpl_toolkits/mplot3d/art3d.py Outdated
Comment thread lib/mpl_toolkits/mplot3d/axes3d.py Outdated
@scottshambaugh scottshambaugh force-pushed the fix-31726-3d-scale-invalid branch from 1516ffe to 4323126 Compare May 24, 2026 18:32
Comment thread lib/mpl_toolkits/mplot3d/art3d.py Outdated
Comment thread lib/mpl_toolkits/mplot3d/art3d.py Outdated
Comment thread lib/mpl_toolkits/mplot3d/art3d.py Outdated
Comment thread lib/mpl_toolkits/mplot3d/art3d.py Outdated
Co-authored-by: Elliott Sales de Andrade <[email protected]>
@scottshambaugh scottshambaugh force-pushed the fix-31726-3d-scale-invalid branch from 8bfcdc4 to 9f4a87a Compare May 26, 2026 16:02
@ksunden ksunden merged commit a682408 into matplotlib:main May 29, 2026
41 checks passed
QuLogic pushed a commit that referenced this pull request May 30, 2026
QuLogic added a commit that referenced this pull request May 30, 2026
…737-on-v3.11.x

Backport PR #31737 on branch v3.11.x (BUG: Don't try to show / autoscale 3D data that lies outside the axis valid scale range)
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.

[Bug]: Corruption of 3D surface plot at log scale with negative or zero values (v3.11.0rc2)

4 participants