How do you make a scattergeo plot wider? The frame seems to be fixed as a square. I want to remove the white areas highlight in yellow on the image below.
fig = go.Figure(go.Scattergeo(
mode = "lines",
lon = cords_sub['gps_lon'],
lat = cords_sub['gps_lat'],
marker = {'size': 10, 'color':'#d30000'},
))
fig.update_geos(
projection_type="orthographic",
)
fig.update_layout(
margin ={'l':0,'t':5,'b':0,'r':0},
)
I have this same issue, and wasn’t able to find a solution. The best I could come up with is generating a rough latitude and longitude range based on the center point of the display.
# Get the center lat and lon
if projection_dict['type'] == "orthographic":
center_lat = projection_dict['rotation']['lat']
center_lon = projection_dict['rotation']['lon']
else:
center_lat = 40
center_lon = -100
# generate a lat_range and lon_range
lat_range = [-90 if center_lat <= -60 else center_lat - 30, 90 if center_lat >= 60 else center_lat + 30]
lon_range = [-180 if center_lon <= -120 else center_lon - 60, 180 if center_lon >= 120 else center_lon + 60]
Then take those lat_range and lon_range values and update the layout.geo of the figure like so:
fig.update_geos(
projection_type="orthographic",
lonaxis=dict(
range=lon_range,
),
lataxis=dict(
range=lat_range,
)
)
It’s not perfect, but it does a decent job of filling most of the space.
Hello @donlan.ryan,
Welcome to the community!
To avoid this issue, since the map is constrained to the margins, I use scatter_mapbox.
1 Like
Appreciate the response. Unfortunately, I am stuck using ScatterGeo because I am working with a legacy dashboard
I recommend adjusting the size and margin to try to make it fill everything.