The scatter charts above indicate the Life Expectancy figures Vs Per Capita GDP in some countries. If you notice the graph to the left looks cleaner than the one to the right. The reason for this is that in the x-axis – the data is taken on a logarithmic scale. Also if you look at the ticks on the x-axis – the one on the left looks neater than the one on the right.
The way this is achieved is by using the plt.xscale(‘log’) syntax. Clearly, as you can see, there is really no relationship between GDP and Life expectancy.
The entire piece of code is given here:
# Basic scatter plot, log scale
xlab = ‘GDP per Capita [in USD]’
ylab = ‘Life Expectancy [in years]’
title = ‘World Development in 2007’
# Add axis labels
# Add title