快开学了啊
pyhton制作中国地图
根据百度中国新型冠状肺炎疫情数据绘制(数据更新至 2020.02.01 21:21),通过python编写程序生成地图,再通过对HTML文件代码重改编写完成。
代码语言:javascript复制from pyecharts import Map
import numpy as np
value = np.array([7153, 599, 535, 422, 389, 297, 286, 247, 207, 206, 202, 169, 156, 144, 101, 100, 96, 91, 80, 63, 62, 47, 38, 35, 29, 26, 23, 18, 17, 13,10,9,7,1])
attr = ["湖北","浙江","广东","河南","湖南","安徽","江西","重庆","四川","山东","江苏","上海","北京","福建","陕西","广西","河北","云南","黑龙江","辽宁","海南","山西","天津","甘肃","贵州","宁夏","内蒙古","新疆","吉林","中国香港","中国台湾","青海","中国澳门","西藏"]
print(len(value))
print(len(attr))
map = Map("截至 2020-2-1 数据统计", width=1000, height=800)
map.add("",attr,value,is_map_symbol_show=True,maptype="china", is_visualmap=True, visual_text_color='#404a59', ##ffffff#000#404a59
is_label_show=True, visual_range=[np.min(value),599])
map.render(r'e:\2020-2-1.html')