plotly / plotly/plotly.py

subplots: colspan >1 to the left of a normal subplot puts the right subplot in the wrong place

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

@emilykl がすでに取り組んでいます。

2025年9月9日 から。

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

説明

In the following example, the "Right subplot" should always appear on the right third of the screen and the subplots should never overlap. When I use a spec list like: [[{"colspan": 2}, {}, None]], the left subplot expands as expected to take up the left and center columns, but the "Right subplot" moves into the middle and overlaps the colspanning-subplot. Part of the colspanning subplot is obscured. If I try to force the "Right subplot" to appear in column 3 after I add the colspan, I get an error because column 3 no longer exists. If you uncomment the widths specification, the titles will collide as well. The "right subplot" should remain in the right column even after we introduce the colspan.


import plotly.graph_objects as go

for n in [0,1]:

    if n==0:  ##TRIVIAL SPEC_LIST THAT WORKS
        spec_list=[[{}, {}, {}]]
        title_tuple = ("Left Subplot","Middle Subplot", "Right subplot")
    else:  ##SPEC_LIST WITH COLSPAN ADJACENT TO A NORMAL CELL THAT FAILS
        spec_list=[[{"colspan": 2}, {}, None]]
        title_tuple = ("Left and Center Subplot","Right Subplot")
 

    fig = make_subplots(

        rows=1, cols=3,

        #column_widths=[2,6,5],

        specs=spec_list,

        subplot_titles=title_tuple)

    

    fig.add_trace(go.Scatter(x=[1, 4], y=[2, 1]),

                    row=1, col=1)


    fig.add_trace(go.Scatter(x=[1, 2], y=[1, 2]),

                    row=1, col=3-n)




    fig.show()
Image

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

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

はじめの一歩

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

評価

この issue はまだ評価されていません。

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

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