library(tidyverse)
library(viridisLite)
library(ggtext)
<- read_csv("population-and-demography.csv")
population_data
<- population_data |>
plot_data # The article mentions Italy, Finland and Japan
filter(Code %in% c("ITA", "FIN", "JPN")) |>
select(!Code) |>
pivot_longer(!c(Entity, Year)) |>
group_by(Entity, Year) |>
# The populations of these countries are very different, so we should normalised them to put them on the same scale
mutate(normalised_value = value / sum(value)) |>
ungroup() |>
# We don't want them in alphabetical order: Japan is the takeaway country
mutate(Entity = factor(Entity, levels = c("Japan", "Italy", "Finland"))) |>
# Only old populations
filter(name == "65+ years") |>
filter(Year >= 1980)
# One trick is to use text labels instead of a legend to draw the reader to a key part of the plot.
# This puts the labels on the right hand side (max(year)) and at the correct height.
<- plot_data |>
labels group_by(Entity) |>
summarise(max_year = max(Year), y_pos = normalised_value[which.max(Year)])
<- c("#2600ff", "#a38687", "#a38687")
colors
ggplot(plot_data, aes(x=Year, y = normalised_value*100, colour = Entity)) +
geom_line() +
geom_point() +
geom_text(aes(label = Entity, x = max_year+1, y = y_pos*100), data = labels, hjust = 0) +
labs(x = "Year", y = "Percentage of population", title = "<span style ='color:#2600ff;'>Japan</span> has the world's oldest population") +
guides(colour = "none") +
# Space for labels
expand_limits(x = 2030) +
# We are only colouring one line - the one we want people to look at!
scale_color_manual(values = colors) +
::theme_cowplot() +
cowplottheme(plot.title = element_markdown()) +
annotate(geom = "text", x = 2030, y = -4, label = "Data source: Our World in Data", size = 2, hjust = 1) +
coord_cartesian(ylim = c(0, 30), clip = "off")
ETC5523: Communicating with Data
Tutorial 2
🎯 Objectives
- Understand structure of journalism articles
- Add data to a story to improve the impact
Introduction
You will be analysing an article from BBC World News about Japan’s ageing population. The article is available online on the BBC website here.
Form small groups (3-5 people) for these exercises.
👥 Exercise 1
- In the article, highlight each section of the “inverted pyramid” model. Note that not all parts of the inverted pyramid may be present in the article.
- Is this article a news feature or a news story? Why?
- Try and write a new headline for the article that conveys a similar message. Remember the principles of concise writing when developing your new headline.
Exercise 2
With a good understanding of the content of the article, in your groups, you are tasked with finding some data to enrich this story, and producing a graphic to add to the article.
You will need to:
Locate a suitable data source,
Write code to load in the data and manipulate it into a format appropriate for visualisation,
Create a clear, concise graphic that supports the message of the story.
Exercise 3
Present your visualisation to the class. Explain why you chose a particular data source, and what the audience can learn from the visualisation.
Try to ensure your graphic adds to the story. You want the visualisation to give extra information to the audience.