Click the Original, Code and Reconstruction tabs to read about the issues and how they were fixed.
Objective
Original Data Visuaisation depicts the 2018 FIFA World Cup prize money on a chart to show how much a team can earn depending on its performance in the tournament. With a total of $400 million reserve, the champions will receive as much as $38.5 million and even even those no having made to play-off will get $8 million each.
Given the visualisation is source from International Federation of Association Football, target audience is likely to be general public having interest in sports, in particular football.
The visualisation chosen had the following three main issues:
Original graph consist of multiple issues of data integrity, at first 9th ranked team is included in two groups in the legends and labeling, secondly it can be observed in the visualistion that for teams from rank 5 to rank 8 prize money is 18 million USD, which will bring to a total of 72 million for that group. However according to main data source it should be 16 million for teams ranked 5 to 8.
Colour schema in the original visualisation is not blind safe particularly for people with Tritanomaly,Protanopia,Deuteranopia or Tritanopia and can be further improved.
Reference
The following code was used to fix the issues identified in the original.
library(ggplot2)
library(ggpubr)
library(dplyr)
#### Creating Data Frame ####
Fifa_world_cup_2<- data.frame(
Prize_money=c(38,28,24,22,16,12,8), Group= factor(c('Champion','Runner up','Third','Fourth','5th-8th','9th-16th','17th-32nd'), levels = c('Champion','Runner up','Third','Fourth','5th-8th','9th-16th','17th-32nd'),ordered = FALSE), Group_money = c(38,28,24,22,16*4,12*8,8*16), Group_size = c(1,1,1,1,2,8,16))
Fifa_world_cup_2<-Fifa_world_cup_2 %>% mutate(Percentage = Group_money/400*100, Propotion = '')
#### Plot 1 #####
p3<-ggplot(data = Fifa_world_cup_2,aes(x = Group, y = Prize_money, fill = Group))+
coord_cartesian(ylim = c(0, 50))+
labs(title = "FIFA World Cup 2018",subtitle = "Total Prize Money per Team(in USD millions)", fill = 'Ranking Group', x= '', y='Prize Money( USD millions)' ) +
theme_classic()+
geom_bar(stat = "identity",colour = "black", width = .8)+
scale_fill_manual(values =rev(c('#d0d1e6','#a6bddb','#74a9cf','#3690c0','#0570b0','#045a8d','#023858')))+
geom_text(aes(label=paste0(Prize_money,'M'), x= Group), hjust = 0.5, vjust= -0.5, color='black',,family="Georgia",size = 3, facefont='bold')
#### Plot 2 #####
p4<-ggplot(Fifa_world_cup_2, aes(x = Propotion, y = Group_money, fill = Group)) +
geom_col(width = 0.6)+
coord_flip() +
labs( caption = "Source: https://resources.fifa.com/", x='Group Propotion',y='Prize Money Reserve (USD Millions)' ) +
scale_y_continuous(sec.axis = sec_axis(trans=~./4, name="Prize Money Reserve (percentage)"))+
geom_text(aes(label = paste0(Percentage,'%') ), position = position_stack(vjust=0.5), vjust=-2, colour='black', size=3) +
geom_text(aes(label = paste0(Group_money,'M')), position = position_stack(vjust=0.5), vjust=2.5, colour='black', size=3) +
scale_fill_brewer(palette = "Set2") +
scale_fill_manual(values =rev(c('#d0d1e6','#a6bddb','#74a9cf','#3690c0','#0570b0','#045a8d','#023858')))+
theme_minimal()
Data Reference
The following plot fixes the main issues in the original.