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 = 某市區(qū)
接下來的代碼和上面有異曲同工之妙哦!相信你一定可以將進行舉一反三的。
