Skip to content
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

Clarify behavior of norm clipping #26481

Merged
merged 1 commit into from Aug 9, 2023
Merged

Conversation

timhoffm
Copy link
Member

@timhoffm timhoffm commented Aug 9, 2023

PR summary

Followup to #26449 (comment)

Closes #26446

Major correction: Clipping does not affect masked values

This can be seen in the following code, where the mask is reapplied

if clip:
mask = np.ma.getmask(result)
result = np.ma.array(np.clip(result.filled(vmax), vmin, vmax),
mask=mask)

This code has been unmodified since 2016 and has been the same even before. I therefore believe it's better to just adapt the documentation to the existing behavior.

Other changes

Better explanation of the returned values for "outside" inputs and their interplay with colormaps.

@timhoffm timhoffm force-pushed the doc-clip branch 2 times, most recently from bcaf8e0 to f1a35f8 Compare August 9, 2023 13:34
@ksunden ksunden merged commit 70ec5ad into matplotlib:main Aug 9, 2023
34 of 36 checks passed
@timhoffm timhoffm deleted the doc-clip branch August 9, 2023 17:08
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.

Disallow clip when vmin and vmax are not set in matplotlib.colors.Normalize
3 participants