pyecharts地图使用
生活随笔
收集整理的這篇文章主要介紹了
pyecharts地图使用
小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
1.首先安裝包
pip install pyecharts==0.5.12.安裝地圖包
依次是全球地圖、中國(guó)省級(jí)地圖、中國(guó)市級(jí)地圖、中國(guó)區(qū)縣級(jí)地圖、中國(guó)區(qū)域地圖
pip install echarts-countries-pypkg?
?
pip install echarts-china-provinces-pypkg?
?
pip install echarts-china-cities-pypkg?
?
pip install echarts-china-counties-pypkg?
?
pip install echarts-china-misc-pypkg
3.代碼
from pyecharts import Map import pyecharts print(pyecharts.__version__) import numpy as np value = np.log10(np.array([1052, 104, 98, 83, 75, 69, 60, 51, 44, 40, 39, 33, 31, 19, 19, 18, 18, 15, 15, 13, 11, 10, 9, 7, 7, 5, 5, 4, 4, 3,3,1]))print(len(value)) attr = ["湖北","浙江","廣東","河南","重慶","湖南","安徽","北京","四川","上海","山東","廣西","江蘇","海南","遼寧","江西","福建","陜西","黑龍江","河北","云南","天津","山西","內(nèi)蒙古","甘肅","香港","貴州","吉林","寧夏","臺(tái)灣","新疆","青海"] map = Map("截至 2020-1-26 12:13:19 數(shù)據(jù)統(tǒng)計(jì)", width=1000, height=800) map.add("",attr,value,is_map_symbol_show=True,maptype="china", is_visualmap=True, visual_text_color='#000',is_label_show=True, visual_range=[np.min(value),np.max(value)]) map.render('./r2.html')?
總結(jié)
以上是生活随笔為你收集整理的pyecharts地图使用的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 显卡的显存
- 下一篇: pdf与图片互相转换