'plotly locationmode for the whole world
I am trying to create a choropleth map for some data of the whole world and I am using plotly to do it but found that locationmode examples are all on Usa-States
Is there a way for me to use it on the world
Solution 1:[1]
Based on the plotly documentation.
Givent that you have a DataFrame of lats ond lons:
import plotly.graph_objects as go
fig = go.Figure(data=go.Scattergeo(
lon = df['lon'],
lat = df['lat'],
mode = 'markers',
))
fig.update_layout(
title = 'world map with markers',
geo_scope='world',
)
fig.show()
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | YScharf |
