Skip to content

Change in custom norm colour map display #20581

Closed

Description

@QuLogic

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.

Activity

  1. added this to the v3.5.0 milestone on Jul 6, 2021
  2. jklymak commented on Jul 6, 2021

    @jklymak
    Member

    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.

  3. jklymak commented on Jul 6, 2021

    @jklymak
    Member

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

  4. jklymak commented on Jul 6, 2021

    @jklymak
    Member

    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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions