Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Merged
QuLogic merged 4 commits intomatplotlib:mainfromdstansby:extend-power-norm
Jan 10, 2024

Conversation

dstansby
Copy link
Member

@dstansbydstansby commentedDec 31, 2023
edited
Loading

PR summary

This updates the behaviour ofPowerNorm 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

@dstansbydstansby mentioned this pull requestDec 31, 2023
6 tasks
@dstansbydstansby marked this pull request as ready for reviewDecember 31, 2023 11:22
tacaswell
tacaswell previously approved these changesJan 3, 2024
@tacaswelltacaswell added this to thev3.9.0 milestoneJan 3, 2024
@dstansbydstansby marked this pull request as draftJanuary 5, 2024 18:43
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
Copy link
MemberAuthor

@dstansbydstansbyJan 6, 2024
edited
Loading

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.

@dstansbydstansby marked this pull request as ready for reviewJanuary 6, 2024 11:55
@tacaswelltacaswell dismissed theirstale reviewJanuary 8, 2024 22:32

problems founds on subsequent review.

@tacaswell
Copy link
Member

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-1 instead of 0?

dstansbyand others added2 commitsJanuary 9, 2024 13:21
Co-authored-by: Thomas A Caswell <tcaswell@gmail.com>
@dstansby
Copy link
MemberAuthor

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-1 instead of 0?

Yes, setting everything under to -1 also fixes the colorbar issue.

@QuLogicQuLogic merged commit6f635b4 intomatplotlib:mainJan 10, 2024
@dstansbydstansby deleted the extend-power-norm branchJanuary 10, 2024 10:28
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@tacaswelltacaswelltacaswell approved these changes

@QuLogicQuLogicQuLogic approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
v3.9.0
Development

Successfully merging this pull request may close these issues.

[Bug]: colors.PowerNorm results in incorrect colorbar
3 participants
@dstansby@tacaswell@QuLogic

[8]ページ先頭

©2009-2025 Movatter.jp