subplots: colspan >1 to the left of a normal subplot puts the right subplot in the wrong place
@emilykl arbeitet bereits daran.
Seit 09.9.2025.
Bewertung
Dieses Issue wurde noch nicht bewertet.
Beschreibung
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()
- Vorherrschende Sprache
- Python
- Sterne
- 18.8k
- Forks
- 2.8k
- Ø Merge
- 13 Std. 41 Min.
- Gemergte PRs (30 T.)
- 21
Beitragsleitfaden
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus plotly/plotly.py
-
P3 size: 1 task
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
-
P3 size: 1 task
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
-
bug P1
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 68/100
-
feature P3
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
-
feature P3
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
Alle Issues in plotly/plotly.py
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
anthropics/skills#1811 · 1 Kommentar ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
speaches-ai/speaches#678 ·
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
datalayer/mcp-compose#42 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
conda-forge/spacy-feedstock#177 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100
UKGovernmentBEIS/inspect_evals#2523 ·