BMI variation with of GDP

Question P7.1.3

A bubble chart is a type of scatter plot which can depict three dimensions of data through the position ($x$ and $y$ coordinates) and size of the marker. The plt.scatter method can produce bubble charts by passing the marker size to its s attribute (in $(\mathrm{points})^2$ such that the area of the marker is proportional to the magnitude of the third dimension).

The files gdp.tsv, bmi_men.tsv and population_total.tsv contain the following data from 2007 for each country: the GDP per person per capita in international dollars fixed at 2005 prices, the body mass index (BMI) of men (in $\mathrm{kg/m^2}$) and the total population. Generate a bubble chart of BMI against GDP, in which the population is depicted by the size of the bubble markers. Beware: some data is missing for some countries.

Bonus exercise: colour the bubbles by continent using the list provided in the file continents.tsv.


Solution