plotly / plotly/plotly.py

Scattermode=group does not autoscale yaxis

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

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

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

説明

I'm plotting some data with a very elaborate box plot series, and attempting to overlay connecting median lines between each box in each series. I can do this successfully, but due the density of information, I need to stagger each x value using boxmode=group and scattermode=group. There are no issues with boxmode, but scattermode causes the lower y min to be set to 0. When scattermode is disabled, everything scales nicely, and when no boxes are drawn, the same issues persists. Using subplots and ensuring shared axes doesn't work, nor does updating axes with autorange.

Code:
`

fig = go.Figure()

point_visibility = point_checked
point_legend = False
box_visibility = True
match box_checked:
    case False:
        box_visibility = False
        point_legend = True

for col in dcr.columns[1:]:
    if box_checked:
        fig.add_trace(go.Box(
            x=dcr['SOC'],
            y=dcr[col],
            name=col,
            legendgroup=col,
            visible=box_visibility,
        ))
    if point_checked:
        fig.add_trace(go.Scatter(
            x=medians['SOC'],
            y=medians[col],
            name=col,
            legendgroup=col,
            showlegend=point_legend,
            visible=point_visibility,
            mode='lines',
        ))

fig.update_layout(
    yaxis_title='DCIR (Ohms)',
    xaxis_title='SOC',
    boxmode='group',
    scattermode='group',  # figure out how to align this to the boxes
)
fig.update_yaxes(autorange=True)  # has no effect

`

Not scaling:
not scaling

Disabling scattermode=group (No longer align to boxes):
no scatter group

What it should look like:
should look like

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

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

はじめの一歩

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

調査の方向性

まず、plotly.py で提供された Box-and-Scatter の例を再現し、scattermode='group' を指定した場合と指定しない場合で y 軸の autorange を比較します。scattermode のグループ化と autorange のエントリポイントを追跡して下限がゼロになる箇所を特定し、その後、box トレースを伴うグループ化された scatter トレースを対象とする回帰テストを追加して、autorange がプロットされたデータと一致することを確認します。

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

評価

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

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

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