Scattermode=group does not autoscale yaxis
Nessuno ha ancora preso questa issue.
- Lingua principale
- Python
- Stelle
- 18.8k
- Fork
- 2.8k
- Merge medio
- 16h 26m
- PR unite (30g)
- 21
Descrizione
I'm plotting some data with a very elaborate box plot series, and attempting to overlay connecting median lines between each box in each series. I can do this successfully, but due the density of information, I need to stagger each x value using boxmode=group and scattermode=group. There are no issues with boxmode, but scattermode causes the lower y min to be set to 0. When scattermode is disabled, everything scales nicely, and when no boxes are drawn, the same issues persists. Using subplots and ensuring shared axes doesn't work, nor does updating axes with autorange.
Code:
`
fig = go.Figure()
point_visibility = point_checked
point_legend = False
box_visibility = True
match box_checked:
case False:
box_visibility = False
point_legend = True
for col in dcr.columns[1:]:
if box_checked:
fig.add_trace(go.Box(
x=dcr['SOC'],
y=dcr[col],
name=col,
legendgroup=col,
visible=box_visibility,
))
if point_checked:
fig.add_trace(go.Scatter(
x=medians['SOC'],
y=medians[col],
name=col,
legendgroup=col,
showlegend=point_legend,
visible=point_visibility,
mode='lines',
))
fig.update_layout(
yaxis_title='DCIR (Ohms)',
xaxis_title='SOC',
boxmode='group',
scattermode='group', # figure out how to align this to the boxes
)
fig.update_yaxes(autorange=True) # has no effect
`
Not scaling:
Disabling scattermode=group (No longer align to boxes):
What it should look like:
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 riproducendo l'esempio Box-and-Scatter fornito in plotly.py, confrontando l'autorange dell'asse y con e senza scattermode='group'. Segui i punti di ingresso del raggruppamento di scattermode e autorange per identificare dove il limite inferiore diventa zero, quindi aggiungi un test di regressione che copra le trace scatter raggruppate con le trace box e verifica che autorange corrisponda ai dati tracciati.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- python
- Ambito
- data-visualization
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100