使用热图的绘图JS,如何删除X轴,Y轴和传奇?在下面您会找到我的代码
热板
var data = [
{
z: z,
type: 'heatmap',
colorscale : [[0, 'rgb(0,0,255)']],
opacity: 1
}
];
Plotly.plot('myDiv', data, {
images: [
{
"source": "../images/img.png",
"xref": "x",
"yref": "y",
"x": -1,
"y": 50,
"sizex": 51,
"sizey": 51,
"sizing": "stretch",
"opacity": 1,
"layer": "above"
}
]
})
aft to foreficial plotly documentation
showing/hiding
我刚刚面对同样的问题。对于热图而言,它不是“传奇”,而是事实证明的“颜色尺度”。如果要禁用它,则可以将var data = [
{
z: z,
type: 'heatmap',
colorscale : [[0, 'rgb(0,0,255)']],
opacity: 1
}
];
Plotly.plot('myDiv', data, {
showlegend: false,
xaxis: {visible: false},
yaxis: {visible: false},
images: [
{
"source": "../images/img.png",
"xref": "x",
"yref": "y",
"x": -1,
"y": 50,
"sizex": 51,
"sizey": 51,
"sizing": "stretch",
"opacity": 1,
"layer": "above"
}
]
})