New to plotly, I’m trying drawing a scatter_map. For some reason, I want to cancel the country border by the code as follows:
fig = px.scatter_mapbox(
df, lat="lat", lon="lon", color="var_c", size='var_s',
custom_data=['city', 'var_c', 'var_s'],
But only the
px.scatter_mapbox works and coutry boundaries have not be deleted.
While I use
go.Scattergeo(), It works:
fig = go.Figure(go.Scattergeo())
I want to know whether update_geos conflict with px.scatter_mapbox(according to offical tutorial, they don’t conflict), and how can I fix it?
Thanks in advance.
If you create a fig returned by
px.scatter_mapbox, then printing
fig.layout you’ll notice
that there is a layout property,
geo. Hence you may not update
geo attributes here.
I solved this question, @empet is right,
px.scatter_mapbox can’t be changed by
update_geos. And if anyone else want to change the style of mapbox, there is my solution:
mapbox_access_token is a string defined before, it’s your own mapbox token, you can get it through https://docs.mapbox.com/ .
And you can create a new style of mapbox (Create a custom style | Help | Mapbox may helps), to delete country boundary, to change themes of map, or do anything you want to do.