Original


Source: /u/UnrequitedReason! on Reddit.com/r/dataisbeautiful.


Objective

The intended objective of the original data visualisation is to highlight the countries that emit the highest amount of CO2 relative to their Gross Domestic Product (GDP). The targeted audience would be the wider community as CO2 levels are tightly related to the issue of Climate Change, which is an issue that affects society as a whole.

The visualisation chosen had the following three main issues:

  • Numerical values are used to indicate data which causes the magnituide of the size of the country to mislead the viewer.

  • The levels of stratification of CO2 levels are not sufficient to accurately convey the data, as the scale of the data is too narrow.

  • The colours used are not ideal to convey the intended message.

Reference

Reddit Thread: https://www.reddit.com/r/dataisbeautiful/comments/d371kq/oc_which_countries_contribute_a_greater/

Data Reference * Muntean, M., Guizzardi, D., Schaaf, E., Crippa, M., Solazzo, E., Olivier, J.G.J., Vignati, E. Fossil CO2 emissions of all world countries 2018 Report, EUR 29433 EN, Publications Office of the European Union, Luxembourg, 2018, ISBN 978-92-79-97240-9, doi:10.2760/30158, JRC113738.

Data source: https://data.worldbank.org/indicator/NY.GDP.MKTP.CD

Alternative Data Source: https://edgar.jrc.ec.europa.eu/overview.php?v=booklet2018

Code

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

library(ggplot2)
library(dplyr)
library(readr)
require(maps)
require(viridis)
#Read and Import Data
co2_eco_capita <- read_csv("C:/Users/harri/OneDrive/Masters of Analytics/S2_MATH2270 Data Visualisation/co2_eco_capita.csv")
world_map <- map_data("world") 
co2_worldmap <- left_join(co2_eco_capita, world_map, by=c("Country"= "region"))
co2_worldmap <- subset(co2_worldmap, Country!="Palau" & Country!="Curaçao") # Outliers 

# Issue: Numerical values are used to indicate data which causes the magnituide of the size of the country to mislead the viewer. 
# Fix: Using a gradient scale to show a clear change in CO2 levels between countries this can be seen by looking at South America and Africa.

# Issue: The levels of stratification of CO2 levels are not sufficient to accurately convey the data, as the scale of the data is too narrow.
# Fix: Removed 2 countries that effected the scale. Used a colour gradient that has a higher stratification  to more accurately shows the difference in CO2 levels. This can be seen by looking at Kazakhstan, Uzbekistan & Kyrgyzstan. On the Orginial authors map, the ratio shows x4, however, there's a clear difference between the three when visualised with the gradients. 

# Issue: The colours used are not ideal to convey the intended message.
# Fix: We used a more pertinent and indicative colour palette that is more associated with the idea of "danger" and "hazard"

#Heat Map of CO2 Per GDP
map <- ggplot(co2_worldmap, aes(x = long, y = lat))+
  geom_polygon(aes(fill = co2_worldmap$`CO2 Per GDP`, group = group))+
  scale_fill_viridis_c(option = "inferno", expression(paste("CO"^"2", "/GDP")), direction = -1)+
  theme_void()+ ggtitle(expression(paste("Heat Map of CO"^"2", " Per GDP 2017"))) +
  coord_fixed(ratio=1.6)+
  theme(  # Change legend key size and key width
  legend.key.size = unit(1.5, "cm"),
  legend.key.width = unit(0.5,"cm"),
  plot.margin = margin(0.5, 0.5, 0.5, 0.5, "cm"),
  plot.title = element_text(hjust = 0.5))

Reconstruction