plotly.js axis 'anchor' attribute

匿名 (未验证) 提交于 2019-12-03 01:22:02

问题:

I'm trying to customize some subplots, but I don't understand what the axis 'anchor' attribute means.

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.

回答1:

To answer my own question, I found the documentation on the axis anchorattribute here.

An x axis can be anchored to a y axis, for example xaxis2: {anchor: 'y2'}means that xaxis2 joins yaxis2 at the origin. If anchoris set to free, the position attribute can then be used to move the axis at another position.

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 falseis just a value used by the python API internally.



回答2:

Although the anchor mechanism is quite simple, seeing a schema from the start would have saved me a lot of time.

So here's a visual explanation of how subplot axes can be handled in 2D. Each pointed arrow represents an "is anchored to" relationship

Sketch based on the official example.



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!