plotly / plotly/plotly.js

add shared axis for Scattergeo and other map plots

Aperta
#6,813 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

feature P3
Lingua principale
JavaScript
Stelle
18.3k
Fork
2k
Merge medio
2g 12h
PR unite (30g)
28

Descrizione

I am trying to create two scattergeo-maps with synchronized axis. It seems like this feature is not implemented, but it would be very helpful. Are there any known workarounds?

Please find a minimal code example below.

from plotly.subplots import make_subplots
import plotly.graph_objects as go

# Geoscatter problem: axis are not synchronized
f_sub = make_subplots(1,2, shared_xaxes="all", shared_yaxes="all", specs=[[{"type": "scattergeo"}, {"type": "scattergeo"}]])

fig1 = go.Figure(go.Scattergeo())
fig2 = go.Figure(go.Scattergeo())

f_sub.add_traces(fig1.data, rows=1, cols=1)
f_sub.add_traces(fig2.data, rows=1, cols=2)

f_sub.show()

# Example for scatter (synchronised axis works)
f_sub = make_subplots(1,2, shared_xaxes="all", shared_yaxes="all")

fig1 = go.Figure(go.Scatter())
fig2 = go.Figure(go.Scatter())

f_sub.add_traces(fig1.data, rows=1, cols=1)
f_sub.add_traces(fig2.data, rows=1, cols=2)

f_sub.show()

Here is a gif of the example that shows how Scatter has a shared x axis, but not Scattergeo (zoom of the map on the left side does not get update):
shared_axis

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 riproducendo l’esempio minimo di make_subplots con due grafici scattergeo e confrontalo con l’esempio funzionante di Scatter. Traccia come vengono gestiti shared_xaxes e shared_yaxes per scattergeo; il lavoro è completato quando lo zoom su una mappa aggiorna l’altra senza introdurre regressioni negli assi sincronizzati per Scatter.

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

Valutazione

Stack tecnologico
javascript, python
Ambito
data-visualization
Tipo di issue
Funzionalità
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.