[BUG]: `vertical_spacing` argument for `make_subplots` should leave space for subplot titles
@SharadhNaidu ci sta già lavorando.
Dal 10/6/2026.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
Description
Setting the vertical_spacing argument of make_subplots to a small value, while also passing subplot_titles, results in a really ugly chart where the subplot titles overlap the subplots themselves.
Ideally vertical_spacing should take titles into account, and control the spacing between the top of the title and the bottom of the subplot above.
We obviously don't know the exact size of the title text, but something like font size * 1.75 should be approximately the right amount of space for a single-line title.
However we need to see whether this requires changes to Plotly.js, since axis.domain only supports units of plot fraction, not sure if there is a way to shift it by a certain number of pixels.
Screenshots/Video
Steps to reproduce
from plotly.subplots import make_subplots
import plotly.graph_objects as go
import random
fig1 = make_subplots(
rows=6, cols=1,
shared_xaxes=True,
vertical_spacing=0.02,
row_heights=[0.35, 0.13, 0.13, 0.13, 0.13, 0.13],
subplot_titles=['Heart Rate Variability', 'Walking', 'Cycling', 'Hiking', 'Other', 'Pilates']
)
for i in range(6):
fig1.add_trace(
go.Scatter(x=[0,1,2], y=[random.randint(0, 10) for _ in range(3)]),
row=i+1,
col=1
)
fig1.show()
- Lingua principale
- Python
- Stelle
- 18.8k
- Fork
- 2.8k
- Merge medio
- 13h 41m
- PR unite (30g)
- 21
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di plotly/plotly.py
-
P3 size: 1 task
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
-
P3 size: 1 task
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
bug P1
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 68/100
-
feature P3
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
-
feature P3
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
Tutte le issue di plotly/plotly.py
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 90/100
learningequality/ricecooker#747 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
BSData/horus-heresy-3rd-edition#3171 ·
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
run-llama/llama_index#23199 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
KhronosGroup/glTF-Blender-IO#2769 ·