Click the Original, Code and Reconstruction tabs to read about the issues and how they were fixed.
Objective
Explain the objective of the original data visualisation and the targetted audience.
The data visualisation was originally published on the website of pixlparade.com, an online publisher with a mission to ‘celebrate infographics, design and beautiful data’ (PixlParade 2020). The stated goal of the visualisation is to uncover the spending priorites of 46 nations by comparing their military vs. healthcare expenditure.
The visualisation seeks to challenge commonly held assumptions with the source article declaring that ‘the average American’s perception of violence is way off the mark’. We can gain some clues into the potential targeted audience by looking at the visualisation itself. The use of a facetted, two-segment coxcomb diagram provides an easy enough high-level interpretability to the uninitiated, and there is a clear focus on drawing the user in through the use of colour, imaging and slick fonts. This points toward a very visual target audience who are drawn to interpretable imagery whilst also being interested in the data behind it.
A further indication of the target audience can be found in the PixlParade ‘About Us’ section which flags a ‘by the people, for the people’ approach to their content by identifying themselves as a “small but mighty bunch of geeks, gamers, designers, and writers”, casting themselves as a band of tech oriented visualists producing for like-minded individuals who are interested in both the data AND the design. The choice of a politically contentious topic, military vs. health care spending also indicates a target audience with an interest in public policy along with an open mind as the visual seeks to challenge established pre-conceptions.
The visualisation chosen had the following three main issues:
Reference
PixlParade 2020, What Countries Spend on Health Care vs. Military Around the World [CHART], PixlParade, viewed 1 September 2020, https://pixlparade.com/what-countries-spend-on-healthcare-vs-military-around-the-world-chart/
SIPRI 2020, SIPRI Military Expenditure Database, Sipri.org, viewed 13 September 2020, https://www.sipri.org/databases/milex
OECD 2019, Health resources - Health spending - OECD Data 2019, OECD, viewed 13 September 2020, https://data.oecd.org/healthres/health-spending.htm
Baglin, J 2020, Chapter 5 Grammar and Vocabulary | Data Visualisation: From Theory to Practice, Appspot.com, viewed 5 September 2020, https://dark-star-161610.appspot.com/secured/_book/grammar-and-vocabulary.html#two-quantitative-variables.
Modify components of a theme — theme 2020, Tidyverse.org, viewed 15 September 2020, https://ggplot2.tidyverse.org/reference/theme.html.
The following code was used to fix the issues identified in the original.
library(ggplot2)
library(dplyr)
library(readr)
library(showtext)
# set the relevant working directory
setwd("C:\\Users\\wmayne\\Uni - Data Visualisation\\Assignment 2")
# read in the dataset using the read_csv function of the readr package
data <- read_csv('healthcare_vs_military.csv')
# add google font
font_add_google("Raleway")
# use the showtext_auto() function to display font in the graph
showtext_auto()
# update the data type of the health_spend and military_spend variables from currency to numeric
data$health_spend <- data$health_spend %>% parse_number()
data$military_spend <- data$military_spend %>% parse_number()
# add a new 'ratio' variable using the mutate function to display %
data <- data %>% mutate(ratio=military_spend/health_spend*100)
# below will reorder the first variable by ratio
data$country <- data$country %>%
factor(levels=data$country[order(data$ratio)])
# create the plot and aesthetic
p1 <- data %>% ggplot(aes(y=country, x=ratio))
# add the layers to the plot
p1 <- p1 +
geom_point(colour="tomato3") +
geom_segment(aes(x=0, y=country, xend=ratio,yend=country),linetype=3) +
labs(title="What Countries Spend on Health Care vs. Military",
subtitle="Military spending as a % of Health Care spending",
x="Percent",
y="Country", caption="Source: Health resources - Health spending - OECD Data (2019) & SIPRI Military Expenditure Database (2020)") +
geom_text(aes(label=paste(round(ratio,1),"%",sep="")), hjust=-.5,size=5) +
scale_x_continuous(limits=c(0,125)) +
theme_void() +
theme(axis.text=element_text(size=13),
axis.title=element_text(size=20, face='bold'),
plot.caption=element_text(size=13,face='italic'),
plot.title=element_text(size=30, vjust=2, face='bold'),
plot.subtitle=element_text(size=25, vjust=3, face='plain'),
text=element_text(family="Raleway"),
panel.grid.minor.x= element_line(colour="grey95"),
panel.grid.major.x=element_line(colour="grey95"),
axis.text.y=element_text(hjust=1))
Data Reference
SIPRI 2020, SIPRI Military Expenditure Database, Sipri.org, viewed 19 September 2020, https://www.sipri.org/databases/milex
OECD 2019, Health resources - Health spending - OECD Data 2019, viewed 19 September 2020, https://data.oecd.org/healthres/health-spending.htm
The following plot fixes the main issues in the original.