Adding secondary-y latex legend name shifts x-axis coordinates
オープン
まだ誰も着手していません。
bug
P3
sev-3
- 主要言語
- Python
- スター
- 18.8k
- フォーク
- 2.8k
- 平均マージ
- 16時間 26分
- マージ済み PR(30日)
- 21
説明
Plotly version 5.20.0.
I am creating subplots with seconary y-axes. When I add the name attribute to a figure that includes a Latex string, the x-axis coordinates are incrementally shifted more and more to the right with each subplot. For instance, the first subplot in this image renders fine, but 2 through 4 are shifted right:
This only happens when including the Latex string.
Here's a minimal working example:
import plotly.graph_objects as go
from plotly.subplots import make_subplots
x = [1, 2, 3, 4]
y = [1]*4
R = 1
C = 4
fig = make_subplots(
rows=R,
cols=C,
specs=[
[{"secondary_y": True} for _ in range(C)]
for _ in range(R)
],
)
rc = [(r, c) for r in range(R) for c in range(C)]
for i, (r, c) in enumerate(rc):
fig.add_trace(
go.Scatter(
x=x,
y=y,
showlegend=not i,
name="y1",
),
row=r+1,
col=c+1,
secondary_y=False,
)
fig.add_trace(
go.Scatter(
x=x,
y=y,
showlegend=not i,
name=r"$y$2",
),
row=r+1,
col=c+1,
secondary_y=False,
)
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
提供された4つのsubplotを持つ最小限の動作例を実行し、LaTeXの凡例名がある場合とない場合でレンダリングを比較してください。レンダリング中にsubplotのx軸座標がどのように計算されるかを追跡し、その後、セカンダリ軸のtraceがLaTeXラベルを使用する場合でも、すべてのsubplotの位置が揃ったままであることを確認してください。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- python
- 領域
- data-visualization
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100