使用Plotly js for heatmap,如何删除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"
}
]
})
发布于 2018-08-03 11:55:24
只需通过转到official 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"
}
]
})
https://stackoverflow.com/questions/51661445
复制相似问题