可用于plotly的locationmode列表

13

我需要制作一个关于巴西数据分布的图形化表示。

我发现 plotly 可以完成这项工作,但是当我去研究如何使用 plotly 时,每个教程都使用 locationmode 属性为 'USA-states'。

是否有国家代码列表,以便我后来查看正确的调用方式?

1个回答

15

文档来源: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.

所以对于巴西,您需要添加这些行:

locations = ["Brazil"],
locationmode = 'country names'

3
如果我需要为巴西的每个州设置值,该怎么办? - Matheus Sant'ana
4
好的,目前不支持该功能。请参考此问题:https://github.com/plotly/plotly.js/issues/1354 - PythonNoob

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接