Click the Original, Code and Reconstruction tabs to read about the issues and how they were fixed.
Objective
The objective of this visualization is to demonstrate the amount of debt that holds from United States’s treasury by foreign holders. The aim of this visualization is to compare the countries in the market world to understand the treasury insecurities issued for foreign countries by U.S. It shows the amount and percentage of the debt owned by foreign countries. This is a platform for understanding foreign investments in United States treasury.
The visualisation chosen had the following three main issues:
Issue 2:The color scaling and visual effects. The color scaling is without any purpose and chosen without any relevance to the data. The top portion of the visualization has red color like China ,Japan,India, Ireland while some of them has lighter color shade of red like Brazil,Iraq and one of the data Other country is in purple color. The background image of the flags of the particular country is additional effect which doesn’t provide any benefits to this visualization.
Issue 3: Area and Size quantity The relative size for the countries depicted in this visualization is misleading. Ther values Mexico and Netherlands which has 0.7% but Mexico appears to be smaller than Netherlands. Area depicting Countries such as Japan and China should accomodate the thrice times area of Brazil . But when you try to compare this relation it is difficult for the user to comprhend them due to its uneven and misguiding area and size quantity.
Reference
The following code was used to fix the issues identified in the original.
# Loading the necessary libraries
library(readxl)
library(ggplot2)
library(dplyr)
# Reading the data file
df<-read_excel("C:/Users/Niki/Desktop/Data Visualiztion/Ass2/Book1.xlsx")
# Converting a dataframe
country=as.data.frame(df)
# Plotting the graph
p<-ggplot(data=country, aes(x=reorder(Country,Amount) , y=Amount, label= Amount)) +
geom_bar(stat="identity",position="dodge",width =1 , color = "black",fill = "steelblue") +
labs(title = "THE BIGGEST FOREIGN HOLDERS OF U.S DEBT (APRL 2019)",
y = "AMOUNT ($ B) ",
x = "COUNTRIES") +
theme_minimal() +
geom_text(hjust = -0.1, size = 2.8)
theme(axis.text.x = element_text(face="bold", size=10),
axis.text.y = element_text(face="bold", size=7.8))
## List of 2
## $ axis.text.x:List of 11
## ..$ family : NULL
## ..$ face : chr "bold"
## ..$ colour : NULL
## ..$ size : num 10
## ..$ hjust : NULL
## ..$ vjust : NULL
## ..$ angle : NULL
## ..$ lineheight : NULL
## ..$ margin : NULL
## ..$ debug : NULL
## ..$ inherit.blank: logi FALSE
## ..- attr(*, "class")= chr [1:2] "element_text" "element"
## $ axis.text.y:List of 11
## ..$ family : NULL
## ..$ face : chr "bold"
## ..$ colour : NULL
## ..$ size : num 7.8
## ..$ hjust : NULL
## ..$ vjust : NULL
## ..$ angle : NULL
## ..$ lineheight : NULL
## ..$ margin : NULL
## ..$ debug : NULL
## ..$ inherit.blank: logi FALSE
## ..- attr(*, "class")= chr [1:2] "element_text" "element"
## - attr(*, "class")= chr [1:2] "theme" "gg"
## - attr(*, "complete")= logi FALSE
## - attr(*, "validate")= logi TRUE
countryplot= p+ coord_flip()
Data Reference
The following plot fixes the main issues in the original.