Hoversubplots=axis not working with make_subplots
未关闭
还没有人认领这个 Issue。
bug
P3
sev-3
- 主要语言
- Python
- 星标
- 18.8k
- 派生
- 2.8k
- 平均合并
- 16 小时 26 分钟
- 30 天内合并 PR
- 21
描述
Initially reported on the Plotly forum.
Using make_subplots means that the hoversubplots=“axis” will not work correctly.
Sample code that produces the error:
Codepen.
import plotly.graph_objects as go
from plotly import data
from plotly.subplots import make_subplots
df = data.stocks()
fig = make_subplots(rows=3, cols=1, shared_xaxes=True, vertical_spacing=0.03)
layout = dict(
hoversubplots="axis",
title="Stock Price Changes",
hovermode="x",
grid=dict(rows=3, columns=1),
)
fig.add_trace(go.Scatter(x=df["date"], y=df["AAPL"], name="Apple"), row=1, col=1)
fig.add_trace(go.Scatter(x=df["date"], y=df["GOOG"], name="Google"), row=2, col=1)
fig.add_trace(go.Scatter(x=df["date"], y=df["AMZN"], name="Amazon"), row=3, col=1)
fig.update_layout(layout)
fig.show()
Expected behavior should be the same as when using the Plotly docs hover on subplots example, where hover labels appear for all charts:
Codepen.
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
首先使用 make_subplots 和 hoversubplots="axis" 布局复现提供的 Python 示例,然后将其与链接的 Plotly 文档示例进行比较。跟踪子图坐标轴和 hover 设置的生成方式;当所有图表都如预期示例所示显示 hover 标签时,即表示完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- python
- 领域
- data-visualization
- Issue 类型
- 缺陷
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 活跃
- 描述清晰度
- 基本清楚
- 新手友好度
- 58/100