Unable to custmize colorscale in contour plotly js

Hi, I am able to make my own colorscale in plotly but whereas it fails in type:contour.

Below is the snippet for it.

olorscale: [
[‘0.0’, ‘rgb(255, 255, 255)’],

['0.001', 'rgb(0,0,100)'],

['0.002', 'rgb(0, 0, 200)'],

['0.05', 'rgb(0, 0, 215)'],

['0.111111111111', 'rgb(0, 0, 235)'],
['0.222222222222', 'rgb(0, 255, 0)'],
['0.333333333333', 'rgb(255,197,1)'],
['0.444444444444', 'rgb(255,98,0)'],
['0.555555555556', 'rgb(255, 48,0)'],
['0.666666666667', 'rgb(255,0,0)'],
['0.777777777778', 'rgb(199,21,133)'],
['0.888888888889', 'rgb(199,21,133)'],
['1.0', 'rgb(255,20,147)']

]

Kindly advice.

Here’s how: https://codepen.io/etpinard/pen/zYYOXWP

Thanks for the reply.

I tried that but I am not able to change the colorscale between 0 to 10%.

['0.001', 'rgb(0,0,100)'],

['0.002', 'rgb(0, 0, 200)'],

['0.05', 'rgb(0, 0, 215)']

This is not changing the colorscale. How can I change the color between 0 to 5% by different scale.

Kindly advice.

We might need to increase the number of drawns contours (e.g. using ncontours) to see the effects.

Thank you so much. It worked fine.

1 Like