上文继续
声明以下使用的包集合
代码语言:javascript复制pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pyecharts==0.5.10
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple echarts-countries-pypkg
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple echarts-china-provinces-pypkg
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple echarts-china-cities-pypkg
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple echarts-china-counties-pypkg
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple echarts-china-misc-pypkg
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple echarts-united-kingdom-pypkg
pip install pyecharts_snapshot
创建【demo12.py】输入以下编码
代码语言:javascript复制from pyecharts import Map
map2 = Map("河北地图", '河北', width=1200, height=600)
city = ['石家庄市', '保定市', '衡水市', '张家口市', '黄骅市', '邢台市']
values2 = [1.07, 3.85, 6.38, 8.21, 2.53, 4.37]
map2.add('河北', city, values2, visual_range=[1, 10], maptype='河北', is_visualmap=True, visual_text_color='#000')
map2.render(path="河北地图.html")
执行后效果图:
希望能对大家有所帮助。