-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Don't clip PowerNorm inputs < vmin #27589
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
Conversation
393b29f
to
b4701cd
Compare
f, ax = plt.subplots() | ||
cb = Colorbar(ax, norm=PowerNorm(gamma=0.5, vmin=0.0, vmax=1.0), | ||
orientation='vertical', extend='both') | ||
assert cb._values[0] >= 0.0 |
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.
This check came in with #11610, but from that PR it seems like it's enough just to add the colorbar and check no error or warning is raised. It's expected that _values
now has a value < 0 with this PR.
I think going with linear is better because it is invertable, but could we have also fixed the colorbar issue more narrowly by setting the under values to |
Co-authored-by: Thomas A Caswell <tcaswell@gmail.com>
Yes, setting everything under to -1 also fixes the colorbar issue. |
PR summary
This updates the behaviour of
PowerNorm
to linearly normalize input values < vmin, instead of clipping them.Fixes #25239; replaces #25256. See discussion at #25256 for more context on this.
PR checklist