首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >Plotly.js :隐藏热图坐标轴和图例

Plotly.js :隐藏热图坐标轴和图例
EN

Stack Overflow用户
提问于 2018-08-03 04:11:00
回答 1查看 1.8K关注 0票数 1

使用Plotly js for heatmap,如何删除x轴、y轴和图例?在下面你可以找到我的代码

heatmap

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"
    }
  ]

})
EN

回答 1

Stack Overflow用户

发布于 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"
    }
  ]

})
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/51661445

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档