from pyecharts.charts import Geo import pyecharts.options as opts from pyecharts.faker import Faker from pyecharts.render import make_snapshot from snapshot_selenium import snapshot as driver

geo = ( Geo() .add_schema(maptype="china") .add(series_name='', data_pair=[(i, j) for i, j in zip(Faker.provinces, Faker.values())]) .set_global_opts(title_opts=opts.TitleOpts(title='中国地图'), visualmap_opts=opts.VisualMapOpts(is_piecewise=True)) )

make_snapshot(driver, geo.render(), "geo.png") geo.render_notebook(


原文地址: https://www.cveoy.top/t/topic/hD3y 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录