Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Change in custom norm colour map display #20581

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

Closed
QuLogic opened this issue Jul 6, 2021 · 3 comments · Fixed by #20582
Closed

Change in custom norm colour map display #20581

QuLogic opened this issue Jul 6, 2021 · 3 comments · Fixed by #20582
Labels
Release critical For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions. topic: color/color & colormaps topic: color/colorbar
Milestone

Comments

@QuLogic
Copy link
Member

QuLogic commented Jul 6, 2021

Compare https://matplotlib.org/stable/tutorials/colors/colormapnorms.html

image

vs https://matplotlib.org/devdocs/tutorials/colors/colormapnorms.html

image

The same thing happens with the custom norm at the end of the tutorial. I'm not sure about TwoSlopeNorm, but at least for the custom one, the 0 is definitely not supposed to be in the middle. This half broke when merging #20054, with the 0 tick at the old place but the 0 colour in the middle. Then with d1c5a6a, the 0 tick also moved to the middle.

@QuLogic QuLogic added Release critical For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions. topic: color/colorbar topic: color/color & colormaps labels Jul 6, 2021
@QuLogic QuLogic added this to the v3.5.0 milestone Jul 6, 2021
@jklymak
Copy link
Member

jklymak commented Jul 6, 2021

The tick moving to the middle is expected - colorbars are supposed to space equally in colourspace (i.e. consider log norm).

The -1000 is more problematic, as that is simply incorrect I believe. Part of the issue here is that two-slope norm doesn't have a scale, and hence doesn't have good ticking.

@jklymak
Copy link
Member

jklymak commented Jul 6, 2021

... the Custom norm is in even worse shape ;-)

@jklymak
Copy link
Member

jklymak commented Jul 6, 2021

OK, the -1000 is because TwoSlopeNorm didn't extrapolate at all, and so -1000 == -500. Adding extrapolation fixes that.

The MidpointNormalize example was broken because MidpointNormalize did not define an inverse. Defining an inverse also fixes this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Release critical For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions. topic: color/color & colormaps topic: color/colorbar
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants