Original


*https://howmuch.net/sources/gdp-unemployment-wages-in-USA


Objective

Above visualization suppose to explain relation between GDP, Unemployment and wages over the past 20 years and can be informative for general audience but because of the poor analysis and less time spent on the details it became confusing and hard to understand rather make it simple and to the point, the lines seems tangled.

The visualisation chosen had the following three main issues:

Issues 1: The chart has two vertical axis as its trying to combined multiple variables GDP, unemployment rate and median household which makes it difficult to understand. Multiple axes one interpreting percentage and the other one plotting median which pretty confusing for the general audience.

Issue 2: Comprehension & accuracy issue as it’s hard to trace the lines that joins to the concerning sector that isn’t very clear to the audience and have to make great effort to understand which goes where.

Issue 3: Despite the color selection is good to eyes and the axes specifies color and lines but still because of the missing legend is not easy to distinguish which lines and color explaining which variables.

Reference

Code

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

library(ggplot2)
library(readr)
library(dplyr)
library(readxl)
library(gridExtra)


dataFrame <- read_excel("Data.xlsx")
#str(dataFrame)

# Chart 1 
p1  <- ggplot()+ theme_bw() + geom_ribbon(data=dataFrame,aes(ymin=-5,ymax=10,x=Year), colour = NA, alpha = 0) +

    geom_line(data=dataFrame,aes(x=Year,y=GDPGrowth*100,color='blue' )) +
    geom_line(data=dataFrame,aes(x=Year,y=JoblessRate*100,color='red'))+
  geom_line(size = 2)+
  
  scale_x_continuous(name = "Year", breaks=1995:2020) + 
    labs(title = " Realation between GDP & Unemployment",
       y = "Percentage %", x = "Year") +
    scale_colour_manual(name = '', 
         values =c('blue'='blue','red'='red'), labels = c('GDP Growth','Unemployment')) +
  theme(legend.position="top") + 
   theme(

    legend.background = element_rect(fill = "white", colour = "black"),
    plot.title = element_text(
      size = rel(1.2), lineheight = 2,
      family = "Calibri", face = "bold", colour = "black"
    )) 
  
# Chart 2

 p2 <- ggplot(data=dataFrame, aes(x=Year, y=Income)) +
  geom_bar(stat="identity", fill="steelblue", width=0.5)  +
  theme_minimal() +
  scale_x_continuous(name = "Year", breaks=1995:2020) +
  scale_y_continuous(breaks = scales::breaks_width(5000, offset = 0)) +
  coord_flip() +
     theme(legend.position="top") +
     labs(title = " Real Median Household Income over the Past 20 Years ",
       y = "Percentage %", x = "Year") +
   
   theme_bw() +
   theme(

    legend.background = element_rect(fill = "white", colour = "black"),
    plot.title = element_text(
      size = rel(1.2), lineheight = 2,
      family = "Calibri", face = "bold", colour = "black"
    )) 

Data Reference

Reconstruction

The following visualizations are simple easy to understand and its explains separately as GDP and Unemployment rate are indirectly proportion to each other and calculated in percentage so it can be easily visualize that if GDP goes up the joblessness goes down whereas household incomes are median of past 20 years so histogram is the best plotting option when it comes interpreting medians.