Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

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

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

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()
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading