This is a template file. The example included is not considered a good example to follow for Assignment 2. Remove this warning prior to submitting.
Click the Original, Code and Reconstruction tabs to read about the issues and how they were fixed.
Objective
Explain the objective of the original data visualisation and the targeted audience:
The objective of the above data visualisation is to present the total amount of taxes in the USA by category, where the total number of Government revenue is colour coded by tax type.
The targeted audience for this data visualisation is those concerned with how popular given industries are and how much they are taxed. This data visualisation can help those who want to start a business in a certain industry, and understanding the taxes can help them make an informed decision.
The visualisation chosen had the following three main issues:
Issue 1: Unconventional shattered circular plot. This shattered circular plot has no axis to define the measurement of taxes by categories. The size of the shapes within the plot can also lead to further deception, as there is no scale for comparison against other sectors in the plot.
Issue 2: Colour issues. There are multiple sections in each given tax type, making it hard for the viewer to distinguish between two different industries in the same tax type. There is also a “Total Taxes” section in the legend as the colour black, however there is no black colouring on the visualisation.
Issue 3: Area and scaling issues. The size of the sections in the visualisation are misleading. “Motor Fuels Sales” and “Corperations net income” have roughly the same amount of taxes at $48.2B, however the “Motor Fuels Sales” section appears to be much bigger than the “Corporations net income” section.
Reference
Carlos, J. (2018). In One Chart: Where Do State Tax Revenues Come From? HowMuch. Retrieved May 1, 2021, from HowMuch.net: https://howmuch.net/articles/breakdown-all-states-taxes-revenue
The following code was used to fix the issues identified in the original.
library(ggplot2)
library(dplyr)
#Reading the data
data<-read.csv("C:\\Users\\Oliver\\Desktop\\aFY2018-STC-Detailed-Table.csv")
#Converting data into a data frame
taxes=as.data.frame(data)
#removing the first rowof the data for plotting purposes as it has text in it
new_taxes<-taxes[-c(1),]
#Plotting the graph
p1<-ggplot(data=new_taxes, aes(x=reorder(Tax.Type,Dollars.in.Billions) , y=Dollars.in.Billions,label=Dollars.in.Billions))+
geom_bar(stat="identity",position="dodge2",width =1 , color = "black",fill = "darkgreen") + coord_flip() +
labs(title = "ALL STATES' TAX REVENUE (2018)",
y = "AMOUNT ($B) ",
x = "TAX TYPE") +
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
Data Reference
The following plot fixes the main issues in the original. As you can see the data is arranged in order from largest to smallest tax type with numbers next to them, making it a lot easier for the viewer to identify the largest tax types in USA.