plotly.js 轴“锚点"属性 [英] plotly.js axis 'anchor' attribute
问题描述
我正在尝试自定义一些子图,但我不明白轴的锚"属性是什么意思.
I'm trying to customize some subplots, but I don't understand what the axis 'anchor' attribute means.
此处使用此属性的一些示例:https://plot.ly/javascript/subplots/ .yaxis2: {anchor: 'x2'}
是什么意思?anchor=false
或 anchor=free
是什么意思?我无法在在线文档中找到解释.
Some examples where this attribute is used are here: https://plot.ly/javascript/subplots/ . What does yaxis2: {anchor: 'x2'}
mean? What does anchor=false
, or anchor=free
mean? I haven't been able to find an explanation in the online docs.
推荐答案
为了回答我自己的问题,我找到了关于轴 anchor
attribute 这里.
To answer my own question, I found the documentation on the axis anchor
attribute here.
可以将 x 轴锚定到 y 轴,例如 xaxis2: {anchor: 'y2'}
表示 xaxis2 在原点连接 yaxis2.如果 anchor
设置为 free
,则可以使用 position 属性将轴移动到另一个 位置.
An x axis can be anchored to a y axis, for example xaxis2: {anchor: 'y2'}
means that xaxis2 joins yaxis2 at the origin. If anchor
is set to free
, the position attribute can then be used to move the axis at another position.
我不确定设置 anchor=false
是否可行,我看到在 plotly.py API 这里,但可能是 false
是只是python API内部使用的一个值.
I'm not sure whether setting anchor=false
is even possible, I saw that used in the make_subplots
function of the plotly.py API here, but it may be that false
is just a value used by the python API internally.
这篇关于plotly.js 轴“锚点"属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!