2022-09-25

Plotly Heat Map Color Scale

How can I set the scale of the colorscale for my plotly heat map independent of the values of the data?

Example data:

const z = [2,5,6,2,6,8,2];

But I would like my color scale to be from 0 to 10, red to green respectively.

So far I have this, which is amazing, but because my max data is 5.2 and min data is 4.2 it is showing that as green for 5.2 and red for 4.2, but I would like to set a static scale from 0-10.

enter image description here



No comments:

Post a Comment