Surface 3D configure colorscale based on values

Hi,

I want to define colorscale of my 3D surface plot based on z-axis values.
for example, I want points with z-axis value < -10 in red color, points with z-axis value between - 10 and 10 in green and point with z-axis value >10 in blue.

Is it possible to do that ?

Regards,

See:

for some examples.

All I want is to do something like this
colorscale: [
[’-10’, ‘rgb(255, 0, 0)’],
[‘0’, ‘rgb(0, 0, 255)’],
[‘10’, ‘rgb(102, 0, 153)’]
],

ColorScale will be depending on zaxis but I want to specify values (like in the example above) not percentage.

Colorscale values must be between 0 and 1. Use cmin: -10 and cmax: 10 to set the bound in data space.

More info:

I see that cmin and cmax have been removed from data in version 1.43.0. Is there any substitution ?

You mean from

var gd = document.getElementById(/* id of your graph */)
gd.data[0].cmin

?

in that case

var gd = document.getElementById(/* id of your graph */)
gd._fullData[0].cmin

should do the trick.