I need to make a graphical representation of data distributed in Brazil, which is my country.
I found that plotly
can do this job, but when I went to research how to use plotly, every tutorial was using the locationmode
attribute as 'USA-states'.
Is there a list with countries codes, so I can go after to see which is the right way of calling it?
locationmode (str) – One of 'ISO-3', 'USA-states', or 'country names' Determines the set of locations used to match entries in locations to regions on the map.
Plotly Geo maps have a built-in base map layer composed of "physical" and "cultural" (i.e. administrative border) data from the Natural Earth Dataset.
Plotly is a free and open-source graphing library for Python. We recommend you read our Getting Started guide for the latest installation or upgrade instructions, then move on to our Plotly Fundamentals tutorials or dive straight in to some Basic Charts tutorials. A Choropleth Map is a map composed of colored polygons.
Plotly provides online graphing, analytics, and statistics tools for individuals and collaboration, as well as scientific graphing libraries for Python, R, MATLAB, Perl, Julia, Arduino, and REST.
From docs: https://plot.ly/python/reference/#scattergeo-locationmode
locationmode ( enumerated : "ISO-3" | "USA-states" | "country names" )
default: "ISO-3"
Determines the set of locations used to match entries in `locations` to regions on the map.
So for Brazil you have to add these lines:
locations = ["Brazil"],
locationmode = 'country names'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With