1、 maptype = 省份
from pyecharts import Geo
data = [('汕头',50),('汕尾市',60),('阳江市',70)]
geo = Geo('广东省空气质量','data from pm 2.5',
title_color = '#fff',
title_pos = 'center',
width = 1200,
height = 800,
background_color='#404a459')
attr,value = geo.cast(data)
geo.add('',attr,value,
maptype = '广东',#默认是china
type = 'effectScatter',
is_random = True,
effct_scale=5,
is_legend_show=False)
geo.render('20.广东空气质量.html')
2、maptype = 中国
from pyecharts import Geo
data = [('北京',50),('上海',60),('深圳',70),('台湾',100)]
geo = Geo('全国空气质量','data from pm 2.5',
title_color = '#fff',
title_pos = 'center',
width = 1200,
height = 800,
background_color='#404a459')
attr,value = geo.cast(data)
geo.add('',attr,value,
maptype = 'china',
type = 'effectScatter',
is_random = True,
effct_scale=5,
is_legend_show=False)
geo.render('21.全国空气质量.html')
3、maptype = 某市区
接下来的代码和上面有异曲同工之妙哦!相信你一定可以将进行举一反三的。