plotly / plotly/plotly.py

fig.add_vline fails on figure with a separate subplot containing Scatter3d

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

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

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

説明

The following code creates a 2D subplot in the left column and a 3D subplot in the right column. Adding a vertical line to the 2D subplot fails if a Scatter3d has been added to the 3D subplot.

Another bug shown in this example is that add_vline does not add any annotations if the plot is empty.

from plotly import subplots
specs = [
    [{}, {'type': 'scene', 'rowspan': 1}],
]
fig = subplots.make_subplots(rows=1, cols=2, specs=specs)

# Add dummy data 
# If both of these are commented out, fig.add_vline does nothing
# If neither are commented out, fig.add_vline raises a PlotlyKeyError
# If fig.add_scatter3d is commented out, the figure is generated successfully
fig.add_scatter(x=[0, 1], y=[0, 1], row=1, col=1)
fig.add_scatter3d(x=[0, 1], y=[0, 1], z=[0, 1], row=1, col=2)

# Add vertical line to left (2D) subplots only
fig.add_vline(x=2, col=1)  # Raises PlotlyKeyError

(Plotly version 5.9.0)

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

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

はじめの一歩

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

調査の方向性

まず、示されている3つのデータ構成を含め、提供された make_subplots、add_scatter3d、add_vline の例を再現します。add_vline のエントリーポイントと、2D および scene サブプロットの処理を追跡します。2D の垂直線が PlotlyKeyError を発生させなくなり、空のプロットにアノテーションが付与されれば完了です。

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

評価

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

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

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