1

I have read the documentation for basemap and I have managed to generate a basic map. I also know, how to plot a (x,y) point.

But, I am confused over how to plot some data on the map with respect to country names?

I have population of each country

Afghanistan | 31822848
Albania     | 3020209
Algeria     | 38813722
Andorra     | 85458
.
.
.

I want to produce a population density map. So populous countries like India and China should be of a dark color while less populous countries should be lighter in color

Is there a way to color each of their countries by their name? I don't have co-ordinates for each of the countries.

My code to generate the world map

map = Basemap(projection='mill',llcrnrlat=-90,urcrnrlat=90,\
            llcrnrlon=-180,urcrnrlon=180,lat_ts=20,resolution='c')
map.drawcoastlines()
map.drawcountries()
map.fillcontinents(color="green")
map.drawmapboundary(fill_color="blue")
Piyush
  • 606
  • 4
  • 16
  • 38
  • [example with pygal](https://github.com/mtkilic/Beginners-Python-Examples/tree/master/Data-visualization) You can take a look at this, its doing exactly what you're trying;however, its been made by Pygal – mtkilic Sep 21 '16 at 18:11
  • Possible duplicate of [Fill countries in python basemap](http://stackoverflow.com/questions/13397022/fill-countries-in-python-basemap) – Mikhail M. Sep 22 '16 at 06:49

0 Answers0