I’m new in Plotly, and struggle with the colors in contour lines.
I have following code:
window.UpdateData = async function (jsonData) {
// Parse the JSON data
zData = JSON.parse(jsonData);
console.log(zData);
data2 = [{
z: zData,
x: [-9, -6, -5, -3, -1],
y: [0, 1, 4, 5, 7],
type: 'contour',
autocontour: false,
contours: {
start: 0.25,
end: 1.25,
size: 0.25,
showlabels: true,
},
colorscale: [[0, 'rgb(2, 171, 44)'],
[0.25, 'rgb(161,255,164)'], [0.5, 'rgb(255,255,65)'],
[0.75, 'rgb(237, 167, 14)'], [1.0, 'rgb(171, 2, 2)']]
}];
}
And I get following result
I don’t understand why I get 6 colors displayed even I only defined 5 in the code.