Skip to content
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

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

Closed
lvlte opened this issue Jun 1, 2023 · 0 comments · Fixed by #6625

Comments

@lvlte
Copy link
Contributor

lvlte commented Jun 1, 2023

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant