画图:各种图暂时我没弄这些东西
词云:之前弄过,忘了,暂时不想搞 画地图:直接上代码;我已经把项目上传到百度云了
import random from pyecharts.charts import Map from pyecharts import options as opts from pyecharts.faker import Faker # map= ( # Map().add('孙洪亮旅游图',[list(i) for i in zip(Faker.country,Faker.values())]) # # ) # map.set_global_opts( # title_opts=opts.TitleOpts(title="连续型数据"), # visualmap_opts=opts.VisualMapOpts(max_= 662000), # ) # map.render('ditu.html') arr = [] s = "" with open("./走过的地区.txt","r") as f: for i in f.readlines(): i = i.replace("\n","").replace(" ","") if i: s = s+i+"\n" temp = [] temp.append(i) temp.append(random.randint(0,50)) arr.append(temp) s = "" for i in range(100): s = s + "1"*50 + "\n" # s = "" map=( Map({"width":"100%","height":"3000px"}) .add('全国',arr,maptype='china',center=[100,100],is_selected=True,is_map_symbol_show=False,zoom=1.2) .set_series_opts(label_opts=opts.LabelOpts(is_show=True)) .set_global_opts( visualmap_opts=opts.VisualMapOpts(max_=50), title_opts=opts.TitleOpts(title=s,pos_left=50,pos_top=50) ) ) map.add('河南',arr,maptype="河南",is_selected=False) map.add('河北',arr,maptype="河北",is_selected=False) map.add('广西',arr,maptype="广西",is_selected=False) map.render('./足迹.html') print("地图已经绘制完成......") wait = input("")