World Map

Pygal's geo-visualization toolkit contains world maps and French-specific maps that offer interesting ways of visualization geo-statistics. Countries and continents are encoded with specific alphabets and names to map countries to the world map canvas.

This example demonstrates the mapping of the world by continents.

continents = { 'Africa' : [ ('africa', 1)], 'Asia': [('asia', 1)], 'Europe': [('europe', 1)],
  'North America': [('north_america'), 1], 'South America': [ ('south_america', 1)],
  'Antartica' : [('antartica', 1)], 'Oceania' : [('oceania', 1)] }

continents
{'Africa': [('africa', 1)], 'Asia': [('asia', 1)], 'Europe': [('europe', 1)], 'North America': ['north_america', 1], 'South America': [('south_america', 1)], 'Antartica': [('antartica', 1)], 'Oceania': [('oceania', 1)]}

You may encounter an error if the package pygal_maps_world is not installed. Simply install it using the following command pip install pygal_maps_world

import pygal 

world_map = pygal.maps.world.SupranationalWorld()
for v in continents.items():
    world_map.add( v[0], v[1])

world_map.render_in_browser()
Pygal ?: 1 0 0 ?: 1 0 0 ?: 1 0 0 ?: 1 0 0 ?: 1 0 0 ?: 1 0 0 ?: 1 0 0 ?: 1 0 0 ?: 1 0 0 ?: 1 0 0 ?: 1 0 0 ?: 1 0 0 ?: 1 0 0 ?: 1 0 0 ?: 1 0 0 ?: 1 0 0 ?: 1 0 0 ?: 1 0 0 ?: 1 0 0 ?: 1 0 0 ?: 1 0 0 ?: 1 0 0 ?: 1 0 0 ?: 1 0 0 ?: 1 0 0 ?: 1 0 0 ?: 1 0 0 ?: 1 0 0 ?: 1 0 0 ?: 1 0 0 ?: 1 0 0 ?: 1 0 0 ?: 1 0 0 ?: 1 0 0 ?: 1 0 0 ?: 1 0 0 ?: 1 0 0 ?: 1 0 0 ?: 1 0 0 ?: 1 0 0 ?: 1 0 0 ?: 1 0 0 ?: 1 0 0 ?: 1 0 0 ?: 1 0 0 ?: 1 0 0 ?: 1 0 0 ?: 1 0 0 ?: 1 0 0 ?: 1 0 0 ?: 1 0 0 ?: 1 0 0 ?: 1 0 0 ?: 1 0 0 ?: 1 0 0 ?: 1 0 0 ?: 1 0 0 ?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