plotly / plotly/plotly.py

[BUG]: barmode="group" not working with second y axis

オープン
#5,582 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

bug P3 size: 3
主要言語
Python
スター
18.8k
フォーク
2.8k
平均マージ
16時間 26分
マージ済み PR(30日)
21

説明

import plotly.graph_objects as go

def bar_chart_with_error_bars():
    # Trace C
    trace_c = go.Bar(
        x=["Trial 1", "Trial 2", "Trial 3"],
        y=[3, 6, 4],
        name="Trace C",
        error_y=dict(
            type="data",
            array=[1, 0.5, 1.5]
        )
    )

    # Trace E (secondary y-axis)
    trace_e = go.Bar(
        x=["Trial 1", "Trial 2", "Trial 3"],
        y=[400, 700, 300],
        name="Trace E",
        yaxis="y2",
        error_y=dict(
            type="data",
            array=[50, 100, 200]
        )
    )

    # Layout
    layout = go.Layout(
        barmode="group",
        yaxis=dict(title="Trace C"),
        yaxis2=dict(
            title="Trace E",
            overlaying="y",
            side="right"
        )
    )

    # Create figure
    fig = go.Figure(data=[trace_c, trace_e], layout=layout)

    # Save to HTML
    fig.write_html("/tmp/trials.html")


# Call the function
bar_chart_with_error_bars()

Resulting chart. Stack instead of group.
Image

rust version is also broken, but in different way - overlay instead of group: https://github.com/plotly/plotly.rs/issues/391

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

まずインラインの Python 再現コードを実行し、生成された /tmp/trials.html を開いて、別々の y 軸上にあるトレースでの barmode="group" と比較します。バーの配置を担当するチャートレンダリングのエントリーポイントを追跡します。2 つのトレースが積み重ねではなく横並びにレンダリングされ、セカンダリ軸の設定とエラーバーが維持されれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
python
領域
data-visualization
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
静か
明瞭さ
おおむね明確
初心者へのやさしさ
45/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。