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

Original


Source: Household Income percentile, 2019-2020 United States.


Objective

The visualisation chosen had the following three main issues:

  • The data is too complicated to understand.
  • Colour and contrast are not used properly.
  • Use of the bar graph is complex.

Reference

Code

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

library(ggplot2)
library(readr)
library(magrittr)
library(tidyr)
my_data <- read_csv("ass2.csv")

df_wide <- my_data %>% pivot_longer(c(year2020, year2019), names_to = "year", values_to = "Income")
plot_household <- ggplot(df_wide, aes(x = Income, y = HIP, color = year)) + geom_line()

Data Reference

Reconstruction

The following plot fixes the main issues in the original.