Empty heatmap color

Hi,
If a heatmap is set only with null value for z, the plot color is set with a the wrong color.
The behaviour is reproduced here: https://codepen.io/matlec/pen/WNdQZpq

The full heatmap should be white, but its gray instead. I am not sure whate we see exactly, is it the ‘0’ colorscale color or is it the plot background ?

Any idea if there is workaround to prevent from this ?

Thanks !
Mathieu

Hi @mat,

When z-data for a heatmap is a constant, c, the constant value is mapped at the mid color of the colorscale. One considers c as the mid value of the interval [c-0.5, c+0.5].
Examples:
z_0
z_1

To remedy this behaviour you can set the zmid value in the heatmap definition and you get the expected heatmap:
z_0-zmid_0_5
z_1-zmid_0_5

Thanks @empet, this fixes my problem !