Click the Original, Code and Reconstruction tabs to read about the issues and how they were fixed.

Original


Source: Chen Han (2022).


Objective

The objective of this visualisation is to show the ranked results of countries competing at the Beijing Winter Olympics, 2022.

The target audience would be a very large and diverse group of the worlds population, primarily the citizens of those countries that have athletes competing in the Olympic Games, and more broadly, anyone with an interest in the Olympic Games event.

The visualisation chosen has the following three main issues:

  • Fails to answer the question of which country received what medals, as the text in the graphic is very small and unreadable.
  • Incomplete data, the data visualisation displays the gold medal tally for each country, whilst not showing the silver and bronze medal tally that each country received. This is only displaying a part of the results of the success of each country.
  • The colour scheme used in this data visualisation distracts the viewer from the story it is trying to tell. The rainbow type colour theme has no corelation to the data being displayed.

Reference

Code

The following code was used to fix the issues identified in the original.

library(ggplot2)
library(tidyr)
library(dplyr)
#import the dataset
medals_in <- read.csv("medals_total.csv")

#pivot long to split the medal tally for each medal type
medals_data <- medals_in %>%
  pivot_longer(cols=Gold:Bronze, names_to = "medal_type", values_to = "count" )

#set the order of medal type
medals_data$medal_type <- factor(medals_data$medal_type, levels=c("Gold", "Silver", "Bronze"))

#reorder by total medal count
medals_data$Country <- reorder(medals_data$Country, medals_data$Order.by.Total, FUN = sum)

p2 <- ggplot(data = medals_data, aes(x = Country, y = count, fill=medal_type)) +
  geom_bar(stat = "identity", width=0.7, position = position_dodge()) +
  theme_classic() +
  labs(title="Beijing Winter Olympics 2022", subtitle="Medal Tally by Country", x="Country", y="Medal Count", fill="Medal Type") +
  scale_fill_manual(values=c("#ebc700", "#a8a8a8", "#CD7F32")) +
  theme(axis.text.x = element_text(angle = 90, vjust=0.5, hjust=0.95), panel.grid.major.y = element_line(color = "grey", size=0.5, linetype=2), plot.title=element_text(hjust=0.5), plot.subtitle=element_text(hjust=0.5))

Data Reference

Reconstruction

The following plot fixes the main issues in the original.