Click the Original, Code and Reconstruction tabs to read about the issues and how they were fixed. #### Original
Objective
The side by side visualisation of the two pie charts was designed to demonstrate the breakdown of market share certain Subscription Video-on-Demand (SVOD) services had during 2019 and 2020.
The side by side visualisation for the market share of streaming services had the following issues:
Reference
The following code was used to fix the issues identified in the original.
library(ggplot2) # Package for creating visualisations
library(readr) # Package for importing data
# Import dataset
SVOD_data <- read_csv("SVOD_2019_2020.csv")
SVOD_data$year_2019 <- c('2019')
SVOD_data$year_2020 <- c('2020')
data_19 <- data.frame(SVOD_data$SVOD_type, SVOD_data$`2019_data`, SVOD_data$year_2019)
data_20 <- data.frame(SVOD_data$SVOD_type, SVOD_data$`2020_data`, SVOD_data$year_2020)
colnames(data_19) <- c("SVOD_type","Percentage","Year")
colnames(data_20) <- c("SVOD_type","Percentage","Year")
SVOD_data <- rbind(data_19,data_20)
SVOD_data$Percentage <- SVOD_data$Percentage * 100
p1 <- ggplot(SVOD_data, aes(x=SVOD_type, y=Percentage, fill=Year)) +
geom_col(width=0.5, position=position_dodge2()) +
ggtitle("Market Share of Subscription Video-on-Demand (SVOD) \n services in the United States (2019-2020)") +
xlab("SVOD") +
ylab("Percentage Market Share") +
theme(plot.title = element_text(hjust = 0.5, size=20), legend.position=c(0.9,0.8), axis.title.x = element_text(size=15), axis.title.y=element_text(size=15), axis.text.x =element_text(size=10), axis.text.y=element_text(size=10)) +
geom_text(aes(label=paste0(Percentage,"%")), position=position_dodge(width=0.5), vjust=-.2)
p1
Data Reference
The following plot fixes the main issues in the original.