中国1949至2019年的gdp图表_Python可视化地图:2019年中国各省GDP情况(pyecharts地理图表)...

e72ba780e3977ecea441618e4656ceb8.png

大家好!

今天来分享一下如何用Python工具来帮助我们制作一张展示2019年中国各省GDP的可视化地图。

4934289c766b5f503a0aa39ea223af75.png

案例中数据表格结构如下:

be27a06f870f372efe9955ab2f571e4b.png

代码及演示:

import numpy as np
import pandas as pd
from pyecharts.globals import ThemeType
from pyecharts import options as opts
from pyecharts.charts import Map

df_map = pd.read_excel("D:01会Excel的隔壁老王Excel报表20200506-Python地图可视化:2019年中国各省GDP情况Python地图可视化:2019年中国各省GDP情况.xlsx")

df_map

368f2e2a99b22d03cd26252affcd1ad4.png
c = (
    Map(init_opts=opts.InitOpts(width="1000px", height="600px",theme = ThemeType.DARK))
    .add("2019年中国各省GDP", df_map[["地区","2019年省GDP总量(亿)"]].values.tolist(), "china")
    .set_global_opts(
        title_opts=opts.TitleOpts(title="2019年中国各省GDP总量(亿)(微信公众号:会Excel的隔壁老王)",pos_bottom = "90%", pos_right = "20%"),
        visualmap_opts=opts.VisualMapOpts(type_= "color",max_=110000, range_text = ['GDP总量(亿)颜色区间:', ''],is_piecewise=1,pos_top= "middle",pos_left="left",orient="vertical",split_number=10),
        #tooltip_opts = opts.TooltipOpts(formatter="{c} %")
    )
    #.render("map_visualmap_piecewise.html")
)

c.render_notebook()

4934289c766b5f503a0aa39ea223af75.png

完整python代码参考:

import numpy as np
import pandas as pd
from pyecharts.globals import ThemeType
from pyecharts import options as opts
from pyecharts.charts import Map

df_map = pd.read_excel("D:01会Excel的隔壁老王Excel报表20200506-Python地图可视化:2019年中国各省GDP情况Python地图可视化:2019年中国各省GDP情况.xlsx")

c = (
    Map(init_opts=opts.InitOpts(width="1000px", height="600px",theme = ThemeType.DARK))
    .add("2019年中国各省GDP", df_map[["地区","2019年省GDP总量(亿)"]].values.tolist(), "china")
    .set_global_opts(
        title_opts=opts.TitleOpts(title="2019年中国各省GDP总量(亿)(微信公众号:会Excel的隔壁老王)",pos_bottom = "90%", pos_right = "20%"),
        visualmap_opts=opts.VisualMapOpts(type_= "color",max_=110000, range_text = ['GDP总量(亿)颜色区间:', ''],is_piecewise=1,pos_top= "middle",pos_left="left",orient="vertical",split_number=10),
        #tooltip_opts = opts.TooltipOpts(formatter="{c} %")
    )
    #.render("map_visualmap_piecewise.html")
)

c.render_notebook()
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值