Skip to content

Contour plot colorscale domain smaller than [zmin, zmax] when contours.coloring is "fill" or "lines" #6623

Closed
@lvlte

Description

@lvlte

Except for the 'heatmap' contour coloring, there seems to be no way to make the colorscale domain fit a fixed range [min, max], whether by setting zmin/zmax or coloraxis cmin/cmax.

For example (cf. https://codepen.io/lvlte/pen/jOejjRE), having z values ranging from 0 to 100, and contour levels from 10 to 90 with a size of 10 :

  • with contours.coloring: "fill", the calculated colorscale domain is [5, 95], excluding zmin and zmax, which can be misleading when we expect the domain to be representative of the actual range of values in z, or any user-defined range set via zmin/zmax or cmin/cmax (adding explicit tickvals to force expand the domain doesn't change anything);
    newplot (6)

  • with contours.coloring: "lines", the colorscale domain is [10, 90] : same problem as above but in addition the colorbar lines for level 10 and 90 are confounded with the borders;
    newplot (8)

  • with contours.coloring: "heatmap", the colorscale domain is [0, 100] as expected;
    newplot (7)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions