今天教大家用pyecharts制作1个滚动的地球,还可以更换主题哦!
方法比较简单,首先安装pyecharts==1.7.1版本,在jupyter notebook编辑器下,输入以下代码:
import pyecharts.options as opts from pyecharts.charts import MapGlobe from pyecharts.faker import POPULATION data = [x for _, x in POPULATION[1:]] low, high = min(data), max(data)c = ( MapGlobe(init_opts=opts.InitOpts()) .add_schema() .add( maptype="world", series_name="World Population", data_pair=POPULATION[1:], is_map_symbol_show=False, label_opts=opts.LabelOpts(is_show=False), ) .set_global_opts( visualmap_opts=opts.VisualMapOpts( min_=low, max_=high, range_text=["max", "min"], is_calculable=True, is_piecewise=True, range_color=["lightskyblue", "yellow", "orangered"