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