当前位置:   article > 正文

notebook显示pyecharts画地图_".add(\"商家a\", [list(z) for z in zip(faker.provinc

".add(\"商家a\", [list(z) for z in zip(faker.provinces, faker.values())], \"chin"

from pyecharts import options as opts

from pyecharts.charts import Map

from pyecharts.faker import Faker

c = (

        Map()

        .add("商家A", [list(z) for z in zip(Faker.provinces, Faker.values())], "china")

        .set_global_opts( title_opts=opts.TitleOpts(title="Map-VisualMap(分段型)"), visualmap_opts=opts.VisualMapOpts(max_=200, is_piecewise=True), )      

        .render("map_visualmap_piecewise.html") )

官方原码

 


map  = (
    Map()
    .add("", [list(z) for z in zip(data['省份'].value_counts().reset_index()['index'].tolist(),data['省份'].value_counts().tolist())], "china",is_map_symbol_show=False,)
    .set_global_opts(title_opts=opts.TitleOpts(title="参加调研的各省份高校个数"),
                    visualmap_opts=opts.VisualMapOpts(max_=15, is_piecewise=True))
    
)
map.render_notebook()#在notebook上显示

data['省份'].value_counts().reset_index()['index'].tolist(),省份的list类型数据

data['省份'].value_counts().tolist(),对应的值的list类型数据

max_,自己数据的最大值

is_map_symbol_show=False,不显示红点

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/IT小白/article/detail/286613
推荐阅读