Skip to content

[ENH]: A "CenteredAsinhNorm" would be useful #30679

@sidneymau

Description

@sidneymau

Problem

The AsinhNorm is very useful for displaying data that can be logarithmic in scale but that comfortably handles the transition from positive to negative values.

As such, it pairs exceptionally well with diverging colormaps when centered at 0 (so that, for example, 0 is white, negative values are blue, and positive values are red).

Currently, AsinhNorm will, by default, infer the vmin/vmax from the data and center accordingly. This will result in a non-centered color scale if. I get around this by manually checking the extrema of the data and using these to set equal but opposite vmin/vmax.

Proposed solution

The proposed solution would be to introduce a new norm, CenteredAsinhNorm, that behaves more similarly to CenteredNorm and SymLogNorm by automatically centering around zero.

I believe this would be accomplished by first introducing a new scale (and for that a new transform), but it's not fully clear to me what the most idiomatic solution would be.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions