gpt4 book ai didi

python - 与绘图一起使用的位置模式列表

转载 作者:行者123 更新时间:2023-11-30 21:55:26 26 4
gpt4 key购买 nike

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

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

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

最佳答案

来自文档: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'

关于python - 与绘图一起使用的位置模式列表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56709920/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com