Black Lives Matter. Please consider donating to Black Girls Code today.
Learn how to use COVID-19 data in open source Dash apps. Register for the Sept 23rd webinar with IQT!

Choropleth of a country distinct than USA

How do I have to set options to make a choropleth of a country distinct than USA? wich locationmode do I have to define in plot_geo function?

g <- list(
scope = ‘peru’,
)

p <- plot_geo(df, locationmode = ‘USA-states’) %>%
add_trace(
z = ~total.exports, locations = ~region,
color = ~total.exports, colors = ‘Purples’
) %>%
layout(geo = g)

Hey @andresrcs

In order to do the provinces of Peru, you would define scope = 'south america' and remove locationmode, then create your own polygon boundaries (with your own data). Something more like this example https://plot.ly/r/county-level-choropleth/#add-polygon-to-a-map-projection

1 Like

Thanks that was very helpful