I’m plotting an African continent map using choropleth. However, some regions are not appearing on the map, even the respective alpha codes being correct. For example, I have data from Seychelles (sov_a3=SYC), Mauritius (sov_a3=MUS), and the map is missing these regions or is not filled.
There is something I’m missing? I didn’t see a complete Africa map made with Plotly and I’m wondering if there is some issue with the parameter scope=“africa”
Follow below the code for the map and how it looks now.
This question and solution are super helpful. As a follow-up, @adamschroeder is there a raw source of information or rule that’s used to determine continents’ scopes, if any, each country/nation shows up with on a Plotly Express choropleth? In other words, are these determined by ISO - International Organization for Standardization or something like that?
My reason for asking is because I often work with diplomacy orgs and am careful about how I represent nations in their recognized status, associations, name labels, etc. So it would be useful to know if there are others besides Seychelles that would not show up with any scope besides world, i.e. that would not appear with the continent scopes ( “africa” | “asia” | “europe” | “north america” | “south america” )?
If your use-case is very sensitive to geographies (e.g. diplomacy!) you should provide your own GeoJSON geometries that have the exact resolution and representation that you seek (for example to correctly display disputed areas, newer ISO codes etc)
The built-in geometries have two different spatial resolutions and the default is the lower resolution which omits certain coastline details and unfortunately omits small (on a global scale!) states like islands and city-states like singapore. You can control the scaling factor as per the docs: Map configuration and styling with Python
I forgot to answer this part of it. There is no ISO standard for geography as far as I know, given how fraught a topic this is. There is a standard for country codes but not the actual lines on the map. Plotly’s built-in maps are sourced every few years from https://www.naturalearthdata.com/ as per our documentation on “cultural base maps”. We don’t update them very often, and we don’t adjudicate competing claims for control or anything.