Practice: Population Maps#

Download starter code

Write a program in main.py that reads in the world dataset and makes a plot containing three axes in one figure. The top-most plot should plot the population (column POP_EST ) by country (the original data format). The middle plot should plot the population aggregated by the sub-region (column SUBREGION ). The last plot should plot the population aggregated by the continent (column CONTINENT ).

The final result should look like the one below.

TODO

Implementation Details#

  • Read the data in from the file geo_data/ne_110m_admin_0_countries.shp

  • Each plot on each axis should have a legend.

  • Recall to save a figure, you can call savefig on a Figure object. You should save the visualization to a file named populations.png .

  • Your program should use the main-method pattern and should not define any global variables.