利用Pytecharts中Geo模块中的maptype绘制地图

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 = 某市区

接下来的代码和上面有异曲同工之妙哦!相信你一定可以将进行举一反三的。

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容