willsonlincake 发表于 2022-4-15 13:31:46

Python世界地图

import pygal

# create a world map
worldmap =pygal.maps.world.World()

# set the title of the map
worldmap.title = 'Countries'

# adding the countries
worldmap.add('Random Data', {
      'aq' : 10,
      'cd' : 30,
      'de' : 40,
      'eg' : 50,
      'ga' : 45,
      'hk' : 23,
      'in' : 70,
      'jp' : 54,
      'nz' : 41,
      'kz' : 32,
      'us' : 66
})

# save into the file
worldmap.render_to_file('abc.svg')

print("Success")
页: [1]
查看完整版本: Python世界地图