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

Original


Source: https://ourworldindata.org/income-inequality#inequality-of-disposable-incomes-over-the-long-run.


Objective

The visual I have chosen is from Income Inequality article by Max Roser and Esteban Ortiz-Ospina. The graph shows the distribution of income shares amongst the highest earners in the country. The objective of the visualization is to show the percentage of country’s wealth going to the top 10% of income earners. The visual is intended for general audience however people with an interest in the finance would be more interested in the visual.

The visualisation chosen had the following three main issues:

  • The Map does not show the names and correct percentage of the country. There should be data labels/exact numbers assigned to each of the country and needs to be visible. Better way of representing this data for countries is in a histogram
  • There is data from 1967-2021 the static version of the image does not encapsulate all of the data present. I have grouped the data by country and averaged the percentage share of the top income earners in the country’s economy to better display the data. I have also split up the data to show the top 50 percent and bottom 50 percent of the richest deciles contribution to the economy.
  • The colour coding of the map does not efficient and not colour blind friendly. I have taken out the need for colour gradient and shown the exact percentage details by using a histogram. I have also used colour blind friendly colours in order for the contrast to be visible.

Reference

Code

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

library(dplyr)
library(ggplot2)
library(knitr)

data <- read.csv("income-share-of-the-top-10-pip.csv",header=TRUE)

latestdata <-data %>%
  group_by(Entity) %>%
  summarise_at(vars(Share.of.the.richest.decile.in.total.income.or.expenditure), list(Avg_share_of_richest_decile_in_total_income = mean))
top50percent<- latestdata %>% slice_max(Avg_share_of_richest_decile_in_total_income, prop = 0.5)
bottom50percent<- latestdata %>% slice_min(Avg_share_of_richest_decile_in_total_income, prop = 0.5)


plot1<-ggplot(data=top50percent, aes(x=Avg_share_of_richest_decile_in_total_income, y=reorder(Entity,Avg_share_of_richest_decile_in_total_income))) + 
    geom_bar(colour="#D41159", stat="identity")+
  labs(x="Average Share of richest 10% in Country's Income",y="Country")+
   theme(text = element_text(size = 5), element_line(size = 0.1)) +
  ggtitle("Top Countries with Average share of richest decile in Total Country Income")

plot2<-ggplot(data=bottom50percent, aes(x=Avg_share_of_richest_decile_in_total_income, y=reorder(Entity,Avg_share_of_richest_decile_in_total_income))) + 
    geom_bar(colour="#1A85FF", stat="identity")+
  labs(x="Average Share of richest 10% in Country's Income",y="Country")+
   theme(text = element_text(size = 5), element_line(size = 0.1)) +
  ggtitle("Bottom Countries with Average share of richest decile in Total Country Income")

Data Reference

Reconstruction

The following plot fixes the main issues in the original.