When creating a subplot with go.Scatter
and make_subplots
you then can update the figure by using fig.update_xaxes(matches='x')
to have the axes follow each other. I couldn’t get that functionality to work when using go.Scattermapbox
. It doesn’t throw an error, it just doesn’t cause the axes to follow each other. Does anyone have any suggestions?
The rough code used to create the subplots is here:
fig = make_subplots(1, 3, specs=[[{'type':'mapbox'}, {'type':'mapbox'}, {'type':'mapbox'}]])
grouped = df.groupby(by='group')
for i, p in enumerate(df.group.unique()):
temp = grouped.get_group(p)
trace = go.Scattermapbox(lat=temp.lat, lon=temp.lon, name=p)
fig.add_trace(trace, 1, i+1)
fig.update_xaxes(matches='x') # this line doesn't work
fig.update_mapboxes(style='carto-positron', zoom=5)
Thank you!