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

Original


Source: WILLisms.com (2005).


Objective

Objective of original data was to show the power of America by presenting the size of its military in terms of the amount spent in comparison with other militarised countries in order of spend. The target audience is the general public with a US more revolutionary audience as the focus. In some cases politicised content agitating for change and publishing a range of topical data both historical, revolutionary and political, typically pro US. The visualisation chosen had the following three main issues: The message it’s trying to deliver is unclear and information is clustered and laid out poorly. The style of plot is harder for the audience to read the information.

The visualisation chosen had the following three main issues:

  • Information is laid out poorly and looks unprofessional causing the message to be unclear.
  • Inappropriate use of colour to place an American flag in the graph depicting superiority rather than simple facts of interest.The colour use could have been better for example use of the flag did not present professionally.
  • There are no labels on the graph itself for country and spend indicator, in addition the visualisation has no reference to what currency it’s in and the date or time period it represents.

Reference

Code

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

library(ggplot2)
library(tidyverse)
library(kableExtra)
library(plotly)
options(knitr.table.format = "html")

options(scipen = 999)
d <- read.csv("Military Expenditure Top 20.csv")
View(d)
colnames(d)[1] <- "Country"

fig1 <- plot_ly(d, x = ~reorder(Country,spending), y = ~spending, type = 'bar',
               color = ~Country,
                             line = list(color = 'rgb(8,48,107)',
                                         width = 1.5))
fig1 <- fig1 %>% layout(title = "Military Expenditure Top 20 countries for 2020",
                      xaxis = list(title = ""),
                      yaxis = list(title = ""))

Data Reference

Reconstruction

The following plot fixes the main issues in the original.