I have a map created with 3d mesh plot, that has my location on x axis, day on y, and frequency on z. I want to add a color scale for the Z axis. But I can’t seem to properly work with the color scale to the all map, and neither to only z axis (that it is what I want). My code is the following:
I was facing the same problem and it was not clear for me from the (Reference Documentation - mesh3d-intensity. After a while I realize that the intensity needs to be an array of the same size as the coordinate arrays. If you want the intensity to change alongside the z axis just set the intensity to the x-coordinate array. In JS it looks like:
var trace = {
x : xArray,
y : yArray,
z : zArray,
colorscale: [[0, 'rgb(0, 255, 0)'], [1, 'rgb(255, 0, 0)']], //or a constant, e.g.: 'YIGnBu',
intensity: xArray,
type: 'mesh3d'
};