Skip to content

Color scale midpoint #3509

Closed
Closed
@nicolaskruchten

Description

@nicolaskruchten

Right now to use a diverging color scale, the user has to do some math outside of plotly.js to ensure that the midpoint is at an appropriate value in data-space. This math is actually almost impossible to do in the case of histogram2d as the data values are computed within plotly.js... I propose a new attribute cmid (or zmid as appropriate) which would make this easier.

If mid is provided and neither min nor max then after the existing automatic computation, whichever of those two is closest to the midpoint will be pushed away by an appropriate amount. If either min or max is provided but not both, then the unspecified one will be set at a distance from mid equal to the distance of the specified one. If both min and max are provided, this setting does nothing.

Feedback before I start implementing?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions