Section 2 Exercise

Considering each of the following figures (including the captions). Some background to each dataset will be given, together with the intended aim of the plot. How might each figure be improved?

  1. This plot uses the mtcars dataset (type ?mtcars for details). The aim is to show the relationship between weight and fuel economy in different models of car.
A plot of fuel economy (mpg) against car weight (wt)

Figure 2.1: A plot of fuel economy (mpg) against car weight (wt)

  1. This plot uses the mvscores dataset from the MAS6005 library. The aim is to compare test match batting scores for one player, Michael Vaughan, between the matches he played as captain, and the matches where he was not captain1. (It is thought the burden of captaincy may affect a player’s form.)
Comparing the England cricketer Michael Vaughan's test match scores, before and after he was made captain.

Figure 2.2: Comparing the England cricketer Michael Vaughan’s test match scores, before and after he was made captain.

  1. This plot uses the inequality dataset from the MAS6005 library. The aim is to show how the UK’s gini coefficient2 compares with that of other countries in the OECD.
Comparing inequalilty as measured by the gini coefficient in OECD countries. The UK is ranked seventh worst.

Figure 2.3: Comparing inequalilty as measured by the gini coefficient in OECD countries. The UK is ranked seventh worst.

  1. This plot uses the medals dataset from the MAS6005 library. The aim is to compare total number of medals won against population size3 in the 2016 Rio olympics.
The total number of medals won at the 2016 Rio Olympics, against population size, for each country that participated.

Figure 2.4: The total number of medals won at the 2016 Rio Olympics, against population size, for each country that participated.

Over the next few sections, we’ll take each plot in turn, and think about how they might be better drawn.


  1. Data obtained from [ http://stats.espncricinfo.com/ci/engine/player/22182.html?class=1;template=results;type=allround;view=match] [Accessed on 21 March 2017]

  2. OECD (2016), Income inequality (indicator). doi: 10.1787/459aa7f1-en [Accessed on 17 August 2016]

  3. Population estimates obtained from [http://data.worldbank.org/indicator/SP.POP.TOTL?end=2015&start=2000] [Accessed on 6 October 2016]. The medal table was obtained from https://www.rio2016.com/en/medal-count-country, but this link is no longer active.