与 plotly 一起使用的 locationmode 列表

Mat*_*ana 7 python plotly choropleth

我需要对分布在巴西(我的国家)的数据进行图形表示。

我发现plotly可以做这个工作,但是当我去研究如何使用 plotly 时,每个教程都使用locationmode属性作为“美国州”。

是否有包含国家/地区代码的列表,以便我可以查看哪个是正确的调用方式?

Pyt*_*oob 8

来自文档: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.
Run Code Online (Sandbox Code Playgroud)

所以对于巴西,你必须添加这些行:

locations = ["Brazil"],
locationmode = 'country names'
Run Code Online (Sandbox Code Playgroud)

  • 但是如果我需要为巴西的每个州设置值怎么办? (2认同)
  • 嗯……那么目前不支持。看到这个问题:https://github.com/plotly/plotly.js/issues/1354 (2认同)