by Anonymous » 15 Sep 2025, 00:17
Wenn ich eine Plotly -Heatmap erstelle und die Achsenbezeichnungen einstellte, wird die Handlung zerstört, wenn es ein Etikett gibt, das auch als Zahl interpretiert werden kann. Siehe das folgende Beispiel: < /p>
Code: Select all
Plotly Heatmap Example
var data = [{
z: [
[1, 20, 30],
[20, 1, 60],
[30, 60, 1]
],
x: ['A', '4 ', 'C'],
y: ['X', 'Y', 'Z'],
type: 'heatmap',
colorscale: 'Viridis'
}];
var layout = {};
Plotly.newPlot('heatmap', data, layout);
Sobald Sie das '4' durch etwas anderes wie 'b' ersetzt haben, funktioniert es:
Wenn ich eine Plotly -Heatmap erstelle und die Achsenbezeichnungen einstellte, wird die Handlung zerstört, wenn es ein Etikett gibt, das auch als Zahl interpretiert werden kann. Siehe das folgende Beispiel: < /p>
[code]
Plotly Heatmap Example
var data = [{
z: [
[1, 20, 30],
[20, 1, 60],
[30, 60, 1]
],
x: ['A', '4 ', 'C'],
y: ['X', 'Y', 'Z'],
type: 'heatmap',
colorscale: 'Viridis'
}];
var layout = {};
Plotly.newPlot('heatmap', data, layout);
[/code]
Sobald Sie das '4' durch etwas anderes wie 'b' ersetzt haben, funktioniert es: