如何固定悬停模板在Plotly Express中的位置
在下面的示例代码中,将有一个悬停表,鼠标悬停在图片上。这真的很酷:
import plotly.express as px
df = px.data.gapminder().query("continent=='Oceania'")
fig = px.line(df, x="year", y="lifeExp", color="country")
fig.update_layout(hovermode="x unified")
fig.show()
,但我的问题是: 有什么方法可以修复此悬停表的位置(例如,在右下角)而不是鼠标位置? 当您将鼠标悬停在图片上时,右下底角上的悬停表值就像默认模式一样更新?
In the example code below, there will be a hover table where the mouse hovers on the picture. which is really cool:
import plotly.express as px
df = px.data.gapminder().query("continent=='Oceania'")
fig = px.line(df, x="year", y="lifeExp", color="country")
fig.update_layout(hovermode="x unified")
fig.show()
but my question is:
is there any way to fix position of this hover table (at right-bottom corner for example) instead of mouse position?
and when you hover the mouse on the picture, the hover table values on right-bottom corner updates just like the default mode?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论