与 plotly 一起使用的 locationmode 列表 [英] List of locationmode to use with plotly

查看:57
本文介绍了与 plotly 一起使用的 locationmode 列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I need to make a graphical representation of data distributed in Brazil, which is my country.

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

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?

推荐答案

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

这篇关于与 plotly 一起使用的 locationmode 列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆