Certain padding values cause plots to overtake all other subplots
Nessuno ha ancora preso questa issue.
- Lingua principale
- Python
- Stelle
- 18.8k
- Fork
- 2.8k
- Merge medio
- 16h 26m
- PR unite (30g)
- 21
Descrizione
Related to #4124 there is a set of padding values that will produce strange behavior such that a single subplot takes over all others.
Some setup:
import numpy as np
import plotly.graph_objects as go
from plotly.subplots import make_subplots
line_x = np.arange(10)
line_y = line_x**2
What works:
n_subplots = 6
full_fig = make_subplots(
rows=n_subplots,
cols=1,
)
for row_idx in range(1, n_subplots+1):
full_fig.add_trace(go.Scatter(
x=line_x,
y=line_y,
showlegend=False,
), row=row_idx, col=1)
This produces 6 different subplots of the same line.
What doesn't work:
line_x = np.arange(10)
line_y = line_x**2
n_subplots = 8
padding_size = 0.1
row_heights = [0.1]*n_subplots
specs = []
for _ in range(n_subplots):
specs.append([{'b': padding_size/2., 't': padding_size/2.}])
full_fig = make_subplots(
rows=n_subplots,
cols=1,
row_heights=row_heights,
specs=specs,
)
for row_idx in range(1, n_subplots+1):
full_fig.add_trace(go.Scatter(
x=line_x,
y=line_y,
showlegend=False,
), row=row_idx, col=1)
Adding the padding and row heights now generates only a single plot.
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.
Direzione di ricerca
Inizia eseguendo gli esempi make_subplots forniti e confronta il caso con sei righe con quello con otto righe usando row_heights e specs padding. Traccia il modo in cui make_subplots gestisce le altezze delle righe e il padding superiore/inferiore, quindi verifica il fix con la configurazione riprodotta. Il lavoro è completato quando tutti gli otto subplots vengono renderizzati separatamente, invece che un subplot prenda il sopravvento.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- python
- Ambito
- data-visualization
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Attiva
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 68/100