plotly / plotly/plotly.js

[BUG]: Y-axis autorange stops working when updating the xaxes range for subplots with shared x-axes and y-axes

Aperta
#8,053 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

bug P2 size: 1
Lingua principale
JavaScript
Stelle
18.3k
Fork
2k
Merge medio
2g 12h
PR unite (30g)
28

Descrizione

Description

Making a subplot figure with shared_xaxes = True, shared_yaxes=True and updating the figure to with an explicit xaxis_range resets the y-axes ranges to (-1, 4).

  • This only happens of both the x-axes and y-axes are shared, and only when updating the x-axes range.
  • It only happens if you actually have more than one row, and more than one column in the figure.
  • Tried with numpy inputs and plain python lists - same result.
Steps to reproduce
import numpy as np
import plotly.graph_objects as go
from plotly.subplots import make_subplots

fig = make_subplots(rows=2, cols=2, shared_xaxes=True, shared_yaxes=True)
x = np.linspace(0, 100, 200)
y = 10 * x
fig.add_scatter(x=x, y=y, row=1, col=1)
fig.add_scatter(x=x, y=y, row=1, col=2)
fig.add_scatter(x=x, y=y, row=2, col=1)
fig.add_scatter(x=x, y=y, row=2, col=2)
fig.update_xaxes(range=(0, 100))
fig.show()

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia con la riproduzione fornita di make_subplots usando shared_xaxes e shared_yaxes, quindi segui il punto di ingresso update_xaxes(range=(0, 100)) in plotly.js. Confronta il comportamento di autorange per il caso di subplot 2×2 con i casi in cui non entrambi gli assi sono condivisi. Il lavoro è completato quando l’intervallo esplicito dell’asse x non reimposta più gli intervalli dell’asse y e la regressione è coperta da un test.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
javascript
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

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.