Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Uh oh!
There was an error while loading.Please reload this page.
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.
Uh oh!
There was an error while loading.Please reload this page.
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 |
Uh oh!
There was an error while loading.Please reload this page.
Co-authored-by: Thomas A Caswell <tcaswell@gmail.com>
Yes, setting everything under to -1 also fixes the colorbar issue. |
Uh oh!
There was an error while loading.Please reload this page.
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