Reassigning Yaxis Labels Inconsistent When Using hoversubplots & hovermode set
オープン
まだ誰も着手していません。
- 主要言語
- Python
- スター
- 18.8k
- フォーク
- 2.8k
- 平均マージ
- 16時間 26分
- マージ済み PR(30日)
- 21
説明
I've been having an issue when you define two xaxes and populate three yaxes per xaxis (in a 2x3) grid while setting "hoversubplots= "axis"", with "hovermode= "xunified"". I've found I cannot rename two of the 6 Yaxis labels.
import plotly.graph_objects as go
from datetime import date
from plotly import subplots
import random
def get_test_data():
x_data, y_data = [], []
for v in range(30):
x_data.append(date(2024, 10, v+1))
y_data.append(random.random())
return x_data, y_data
data= []
for yaxis in range(1,7):
if yaxis % 2:
xaxis = "x1"
else:
xaxis= "x2"
x, y = get_test_data()
data.append(go.Scatter(x= x, y= y, xaxis= f"{xaxis}", yaxis= f"y{yaxis}", name= f"Test{yaxis}y{yaxis}"))
titles = ["First","Second","Third","Fourth","Fifth","Sixth"]
layout = dict(
hoversubplots= "axis",
hovermode= "x unified",
title= "Test Plot",
font= dict(
family= "Courier New, monospace",
size= 14,
color= "rgba(255,255,255,1)"),
plot_bgcolor= "rgba(0,0,0,1)",
paper_bgcolor= "rgba(0,0,0,1)",
grid= dict(rows=3, columns=2),
)
figure= subplots.make_subplots(rows= 3, cols=2, subplot_titles= titles, specs= [[{},{}] for i in range(3)])
figure.add_traces(data[0])
figure.add_traces(data[1])
figure.add_traces(data[2])
figure.add_traces(data[3])
figure.add_traces(data[4])
figure.add_traces(data[5])
figure["layout"][f"yaxis1"]["title"] = "yaxis1"
figure["layout"][f"yaxis2"]["title"] = "yaxis2"
figure["layout"][f"yaxis3"]["title"] = "yaxis3"
figure["layout"][f"yaxis4"]["title"] = "yaxis4"
figure["layout"][f"yaxis5"]["title"] = "yaxis5"
figure["layout"][f"yaxis6"]["title"] = "yaxis6"
figure.update_layout(layout)
figure.update_xaxes(gridcolor="rgba(80,80,80,1)", showticklabels= True)
figure.update_yaxes(gridcolor="rgba(80,80,80,1)", autorange= True, showticklabels= True)
figure.show()
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
提供された Python 再現コードを実行し、hoversubplots="axis" および hovermode="x unified" における 6 つの y 軸の生成された図のレイアウトとホバー動作を調査してください。割り当てられた y 軸タイトルのうち 2 つが表示されない理由を追跡し、6 つすべてのラベルを一貫して名前変更でき、その動作が回帰テストでカバーされていれば、issue は完了とみなしてください。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- python
- 領域
- data-visualization
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 38/100