Click the Original, Code and Reconstruction tabs to read about the issues and how they were fixed.
Original Data Visualization
Objective
The objective of the representation is to communicate the debt grown that had been seen around the word after one year of Covid-19. It indicates the way each country had borrow money to overcome the health crisis and keep the local economy going. However, not all countries had the same wealth, making the new acquired financial obligations more sizable in relation to its Gross Domestic Product (GDP). Position, country size and a band colors were used to display debt magnitude.
Furthermore, it is challenging to infer what function the visualization had. At the beginning I thought it is explanatory as the title suggested “The State of the World’s Government Debt” at the top. However, when you look in detail the chart and try to gather the meaning of it by taking into account country order, size and color, it becomes exploratory as the user needs to take some time to process the way the information was presented and then find an answer. Also, it does not trigger too much emotions in the reader.
Audience
The targeted audience is people with a middle to advanced degree of knowledge on economics as the chart does not have a clear definition of terms such as GDP and does not have annotations to guide the reader which implies the reader should have prior knowledge on how the ratio is calculated and the implications of the grown value of in the context of the local economy. Perhaps, the audience that is targeting are middle age readers with an university degree or some sort of formal education as well or prior subject-knowledge expertise that is convenient to understand the meaning of the chart. All those reasons would make the size of the audience limited.
Issues Analysis and Identification
Failure to answer the question
The chart is very interesting as it is plotting a representation of an important topic for all governments and its citizens around the world at this time. Therefore, the question is understandable and attractive as eventually all countries will need to decide how to solve this issue. Also, the data source is dependable as the International Monetary Fund (IMF) is a known source for this type of data.
However, the visualisation made it difficult to answer the question after you have analised the 3 big countries found on the middle of the chart, it becomes a time consuming excercise to look for other countries which are not as well represented as those 3. Leaving a side, the time readers need to spend digesting the quantity of data and the way it was presented on the chart. In contrast, a conventional world map, less ratio bands and better color will massively help to answer the question to readers.
Perceptual
The visualisation is convoluted and hard to understand as the reader needs to spend a lot time trying to make sense of the chart. A vortex form is not commonly used to represent ranking or ratios and geographical data. It differ 180 degrees from a standard map. Initially, I spent a well 7 minutes just trying to understand the way data was presented (vortex) and making sense of all the displayed details on the visualization before I even remember what I was looking for. A world map will serve better for this purpose, we had seen maps since a early age what help connect the data with locations instantly in our brains.
Also, having a world map will remove a lot of information clutter and complexity for the viewers as they don’t need to process country size, shape and position, to find an answer. Such variables distract the reader and take considerable time to process.
Other issue, is the selected colors. From research green is not a desirable color to represent debt as green represent money, growth, freshness. Using green as one of the colors here may confuse the user as it implies it is desirable to have debt, even if it is less than 50% of the annual GDP. Assumption that is incorrect as debt is a significant burden for governments and individuals and it should not be presented in a lightly manner. My approach will be using a different color pallet starting at orange which represents ignorance and ending with red which represents danger. Using those color transitions will trigger emotions and help to identify countries with low to higher debt simpler and faster. Which also removes the extra issue of band transition as the selected color palettes for green and red are almost undetectable on the original chart for countries in a close ratio. Furthermore, the combination of red and green color in the same chart is not recommended, some users may have color blindness, which would make the information on the chart less visible or invisible for them.
Finally, the number of bands will be reduced to 5 with more significant changes on percentage to help reader interpretation.
Visual Bombardment
The visualization had many dimensions that made it difficult to follow. The chart aimed to combine position, order, shape, size, labels, percentage and color contrast all at once making it deceptive for the reader. Initially the shape looks attractive as it resembles a rose but when you start to get close and remember the so what question, the chart becomes misleading and confusing to read, leaving the reader with the only option to spend between 5 to 10 minutes to grasp the meaning of the information presented and answer the initial query that bring she or him to the chart.
Visualization Reference
Irena Martincevic - Visualizing the State of Government Debt Around the World (Update, 2021). Online article, Published online at howmuch.net, May 7, 2021 Viewed August 1, 2021 https://howmuch.net/articles/state-of-the-worlds-government-debt-2021
The following code was used to fix the issues identified in the original.
library(ggplot2)
library(tidyverse) # Useful for data wrangling
imf <- read.csv("data/imf_2021.csv") #this reads in the source data file, you will need to change the path on your computer
mapdata <- map_data("world") ##ggplot2
View(mapdata)
mapdata <- left_join(mapdata, imf, by="region")
View(mapdata)
glimpse(mapdata)
## Rows: 99,338
## Columns: 7
## $ long <dbl> -69.89912, -69.89571, -69.94219, -70.00415, -70.06612, -~
## $ lat <dbl> 12.45200, 12.42300, 12.43853, 12.50049, 12.54697, 12.597~
## $ group <dbl> 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2,~
## $ order <int> 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 13, 14, 15, 16, 17, 1~
## $ region <chr> "Aruba", "Aruba", "Aruba", "Aruba", "Aruba", "Aruba", "A~
## $ subregion <chr> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, ~
## $ perc_debt_GDP <dbl> 130.3, 130.3, 130.3, 130.3, 130.3, 130.3, 130.3, 130.3, ~
# A visual representation of the missing values help us to understand better the data set. However, Knit generated a error when it is run. Hence, the code line was not execute.
#aggr_plot <- aggr(mapdata, col=c('navyblue','yellow'), numbers=TRUE, sortVars=TRUE, labels=names(mapdata), cex.axis=.7, gap=3, ylab=c("Histogram of missing data","Pattern"))
#number of missing values on the df
colSums(is.na(mapdata))
## long lat group order region
## 0 0 0 0 0
## subregion perc_debt_GDP
## 63154 0
#a map plot to see if the whole data is presented. A
maptemp<-ggplot(mapdata, aes( x = long, y = lat, group=group)) +
geom_polygon(color = "black")
maptemp
#Antarctica required a big portion if the chart. A decision was made to removed to improve size and chart aesthetic.
#Also, this territory does not belong to a specific government.Therefore, the debt ratio is not available.
mapdata <- mapdata[!(mapdata$region=="Antarctica" ),]
maptemp<-ggplot(mapdata, aes( x = long, y = lat, group=group)) +
geom_polygon(color = "black")
maptemp
# a new categorical value was created to help the plotted the proposed output
mapdata <- mutate(mapdata,
perc_debt_bands=cut(mapdata$perc_debt_GDP,
breaks=c(-Inf, 50, 100, 150, 200, Inf),
labels=c("<50%", "50-100%", "100-150%", "150-200%", ">200%")))
#A quick review of the factors and levels of the new variable
unique(mapdata$perc_debt_bands)
## [1] 100-150% <50% 50-100% 150-200% >200%
## Levels: <50% 50-100% 100-150% 150-200% >200%
#A new order is given to help plotting the data on the map.
mapdata$perc_debt_bands <- factor(mapdata$perc_debt_bands,levels=rev(levels(mapdata$perc_debt_bands)))
#the debt map is assemble using ggplot2
debtmap<-ggplot(mapdata, aes( x = long, y = lat, group=group)) +
geom_polygon(aes(fill = perc_debt_bands), color = "black")
debtmap
#A customary color pallet is creating, taking into consideration the recommendation made on colorbrewer website for blind, photocopy and LCD friendly friendly.
mapPalette <- c("#bd0026","#f9390e","#ff8200","#feb200","#fed15c")
# Data Visualization Checklist by Stephanie Evergreen & Ann K. Emery was used to improve the design of the visualization.
debtmap <- debtmap + scale_fill_manual(values=mapPalette)+
theme_bw() +
labs(fill= "Debt to GDP Ratio 2021 (%)", title = "State of the World's Government Debt",
subtitle = "Debt to GDP Ratio in Percentage (2021)",
caption = "Data Source: International Monetary Fund (IMF) - https://www.imf.org/en/Home")
debtmap
#Text, alignment, color, lines and overall checkpoint.
debtmap <- debtmap +
theme(legend.text = element_text(size=9),
axis.text.x = element_blank(),
axis.text.y = element_blank(),
axis.ticks = element_blank(),
axis.title.y=element_blank(),
axis.title.x=element_blank(),
panel.grid = element_blank(),
legend.position = c(0.2,0.1),
plot.title = element_text(size = 24, face = "bold"),
plot.subtitle = element_text(color = "#969696" ,size = 16),
plot.caption = element_text(color = "#969696" ,size = 9, face = "italic"),
rect = element_blank())
debtmap
Data Reference
World Economic Outlook (April 2021). Published online at imf.org.com, 2021. Viewed August 1, 2021 https://www.imf.org/external/datamapper/GGXWDG_NGDP@WEO/OEMDC/ADVEC/WEOWORLD/VEN/AFG
The following plot fixes the main issues in the original.
debtmap
Note: The image scale on the markdown make the chart legend to overlap the map. Please review the PDF version below.
https://drive.google.com/file/d/14G5cPfQvAN3fN5l-v6-EDO7I-Jg18Rz8/view?usp=sharing
How many data dimensions are there?
4 dimensions
For each data dimension what visual variable is used to represent the data?
latitude, longitude, Shape(country) and color(ratio).
Based on the visual comparison accuracy, you can give a ranking of the data dimensions based on their importance?
Reference
James Baglin, Data Visualisation: From Theory to Practice, Published online, 2020-08-04 Viewed August 1, 2021 https://dark-star-161610.appspot.com/secured/_book/index.html
Colors_(ggplot2). Online article, Published online at cookbook-r.com, 2021 Viewed August 1, 2021 http://www.cookbook-r.com/Graphs/Colors_(ggplot2)
Cynthia Brewer, Mark Harrower and The Pennsylvania State University. Published online at colorbrewer2.org, 2013. Viewed August 1, 2021 https://colorbrewer2.org/#type=sequential&scheme=Oranges&n=5
Michael Toth, A Detailed Guide to ggplot colors. Published online at r-bloggers.com, May 15, 20192. Viewed August 1, 2021 https://www.r-bloggers.com/2019/05/a-detailed-guide-to-ggplot-colors/
Joachim Schork, Change Display Order of ggplot2 Plot Legend in R (Example). Published online at statisticsglobe.com, Oct 3, 2020. Viewed August 1, 2021 https://statisticsglobe.com/change-display-order-of-ggplot2-plot-legend-in-r
Tableau Zen Master Jeffrey Shaffer, 5 tips on designing colorblind-friendly visualizations. Published online at statisticsglobe.com, April, 2016. Viewed August 1, 2021 https://www.tableau.com/about/blog/examining-data-viz-rules-dont-use-red-green-together
Fahad Muhammad, Ultimate Guide to Color Psychology with Examples. Published online at instapage.com, June 13, 2021. Viewed August 1, 2021 https://instapage.com/blog/ultimate-guide-to-color-psychology
Lily Vanity, Art of Aesthetics- Truth, Beauty & the Good life. Published online at ladylilyvanity.tumblr.com, 2021. Viewed August 1, 2021 https://ladylilyvanity.tumblr.com/post/58196641916/positive-and-negative-of-all-colors
Stephanie Evergreen and Ann Emery, Data Visualization Checklist. Published online at stephanieevergreen.com, 2021. Viewed August 1, 2021 https://stephanieevergreen.com/data-visualization-checklist/
KPG Talkie, GGPlot Tutorial 1-9. Published online at youtube, Dec 27, 2020. Viewed August 1, 2021 https://youtu.be/TrFH_V_5mcg?list=PLc2rvfiptPSSE9l2wamwKssC7IkSYO2Xu
Tiffany France,Choosing Fonts for Your Data Visualization. Published online at medium.com, June 8, 2020. Viewed August 1, 2021 https://medium.com/nightingale/choosing-a-font-for-your-data-visualization-2ed37afea637
Alboukadel ,How to Change GGPlot Legend Order. Published online at datanovia.com, Jan 5, 2019. Viewed August 1, 2021 https://www.datanovia.com/en/blog/how-to-change-ggplot-legend-order/
ZACH , How to Change Legend Size in ggplot2 (With Examples). Published online at statology.org, Oct 16, 2020. Viewed August 1, 2021 https://www.statology.org/ggplot2-legend-size/