plotly / plotly/plotly.py

Polar barplots do not have reset zoom available

未关闭
#3,889 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

bug P3
主要语言
Python
星标
18.8k
派生
2.8k
平均合并
16 小时 26 分钟
30 天内合并 PR
21

描述

I'm creating polar barplots to visualize angular histograms. These plots do have a zoom option in the modebar, but not a resetScale or zoomout. So I can zoom in, but there is no way to zoom out again.

Trying to add these buttons explicitly doesn't work. The modebar_add function does not throw an error, but no buttons are added either.

import plotly.graph_objects as go
import numpy as np

fig = go.Figure()

bins = np.linspace(0,358,180)
arr = np.array(bins)

series = [90+20*np.random.normal() for _ in np.arange(100)]

count, division = np.histogram(series, bins=bins)

fig.add_trace(go.Barpolar(
    r=count,
    theta=series,
    width=1,
    marker_line_width=2,
    opacity=0.5,
    base=0
))

fig.update_layout(
    title='Polar histogram',
    width=1000,
    height=1000,
    template=None,
    polar = dict(
        angularaxis = dict(showticklabels=True,
                           ticks='',
                           ),
    ),
    modebar_add=['resetScale',
                 'zoomout'],
)


fig.show()

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

首先运行提供的 Python 重现代码,并检查极坐标柱状图如何暴露 modebar 操作,尤其是 resetScale 和 zoomout。确认缩放和重置的预期行为,然后添加或更新相关的回归测试覆盖,确保这两个按钮在此图表类型中都能正常工作。

由索引模型根据 Issue 内容生成。

评估

技术栈
plotly, python
领域
data-visualization
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。