使用plotly,我如何才能垂直显示这个文本?

发布于 2017-02-22 03:17:18
通常我会说“给我们看一些代码”,但绘图完全弥补了这一点。
这里需要的主要功能是textangle来指定以度数为单位的旋转。只需添加一个annotation,隐藏arrow (showarrow: false)并设置x/y位置。
Plotly.plot('myDiv', [{
x: [0, 2, 3, 4, 6, 7, 10],
y: [0, 1, 3, 4, 6, 9, 10]
}], {
annotations: [{
x: 6.75,
y: 7.25,
text: 'Vertical',
textangle: '-55',
showarrow: false
}]
});<script src="https://cdn.plot.ly/plotly-latest.min.js"></script>
<div id='myDiv' width=300 height=300></div>
https://stackoverflow.com/questions/42368568
复制相似问题