赞
踩
>pip install pygal_maps_world
2.wm.add(标签,列表),每次调用一次add()都将再换一种颜色
import pygal.maps.world
wm=pygal.maps.world.World()
wm.title='North, Central, and South America'
wm.add('North America',['ca','mx','us'])
wm.add('Central America',['bz', 'cr','gt','hn','ni','pa','sv'])
wm.add('South America',['ar','bo','br','cl','co','ec','gf','gy','pe','py','sr','uy','ve'])
wm.render_to_file('americas.svg')
svg结果是
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。