Python: easy way to create worldmap data distribution
I'm looking for an easy way to create a worldmap in python. For example, let's take the following country data:
world_data = {
'af': 141,
'bd': 5,
'by': 2,
'cn': 10,
'gm': 90,
'in': 43,
'ir': 314}
Is there any easy way to create a world map with custom coloration and color threshold for this data?
I am currently using pygal (see below). Unfortunately I didn't find a way for the pigal to print a color legend or define thresholds for coloring.
worldmap_chart = pygal.Worldmap()
worldmap_chart.add('data', world_data)
worldmap_chart
Any help is appreciated
+3
source to share
1 answer
You can use any Python data visualization library, including:
Here is a list of some of the tool reviews:
I prefer a combination of Python and D3.js, which is a Javascript rendering library. Here's an example of using a map:
http://adilmoujahid.com/posts/2015/01/interactive-data-visualization-d3-dc-python-mongodb/
+1
source to share