plotly / plotly/plotly.js

add shared axis for Scattergeo and other map plots

Open
#6,813 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature P3
Dominant language
JavaScript
Stars
18.3k
Forks
2k
Avg merge
2d 12h
Merged PRs (30d)
28

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the minimal make_subplots example with two scattergeo plots and compare it with the working Scatter example. Trace how shared_xaxes and shared_yaxes are handled for scattergeo; done means zooming one map updates the other without regressing synchronized axes for Scatter.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, python
Domain
data-visualization
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.