One of the original bits however, was a sequence of diagrams suggesting ways to make a timeseries easier to understand. The principles we use are set out briefly in the talk:
- Remove non-data ink (or pixels), where possible.
- Don’t make the reader work too hard.
- Design is choice: what is it you are trying to say?
The dataset is “ldeaths” – monthly deaths due to lung disease in the UK in the late 1970s. The dataset is one that ships with R, and is available by just typing “ldeaths” into the console. To see other avalilable datasets, just type data() into the command line.
We start with the default output from R:
We’ve added a caption to help identify the lines. the dataset “ldeaths” only gives the total, so we’ve added “mdeaths” (males) and “fdeaths” (females) to the plot. There is clearly a strong seasonal signal, but can we make the plot any clearer?
First, we’ll fix the aspect ratio. Tufte suggests that the average slope of a timeseries should be around 45 degrees, but there are clearly choices to be made here. For example, many timeseries can be fit on a page for comparison, if the aspect ratio is higher.
We’ve also added a legend in the top right, although it is tricky to quickly identify which label belongs to which line. It might be clearer to label the lines directly:
We’ve also rotated the y-axis labels, removed the distracting box, and tried to reduce the impact of the (unimportant) axis lines.
Other Design Choices
The same trick with the palettes can be used if you want to highlight some aspect of the data – perhaps using a restricted palette of colours in order to draw attention to something:
Finally, we notice that the timeseries can be simplified. As the “Total” is just the sum of the “Males” and “Females”, we can get rid of one of the lines altogether. The plot might be better as a stacked timeseries:
This visualisation obviously owes a great deal to the marvellous baby name wizard. And yes, we have chosen those colours on purpose, as pink is a nice strong shade for boys. It also serves as a reminder that the palette you choose will have cultural baggage, so best to take that in into account from the start.
How would you change the figures? Suggestions for improving the plots are, as always, very welcome.
After comments from Lucia, this post was edited sightly (added subheading “Other design choices”) to make it clear that the last two plots are not necessarily an improvement, but might highlight different aspects of the data.