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



Comments

Popular posts from this blog

Today Walkin 14th-Sept

Spring Elasticsearch Operations

Hibernate Search - Elasticsearch with JSON manipulation