List of locationmode to use with plotly

我怕爱的太早我们不能终老 提交于 2020-08-03 03:59:20

问题


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?


回答1:


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'


来源:https://stackoverflow.com/questions/56709920/list-of-locationmode-to-use-with-plotly

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!