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 targetted audience.
The visualisation chosen had the following three main issues:
The pie chart is not the best choice here for accurate and straghitforward comparisons. Also, one pie chart cannot handle one or more variables at the same time. That is why two pie charts are used in this data visualisation, which is not an optimal option.
The authors fail to label all sectors with their percentages, which provides less information for audiences. Additionally, there is negative value (energy earning) in the original data, but it is somehow still put in pie chart.
Colour issues: The background colours do not provide sufficient contrast so it is hard for audiences to read the numbers on the pie charts. The colours of different sectors of pie charts are so similar such that audiences cannot easily distinguish them.
Reference
The following code was used to fix the issues identified in the original.
library(ggplot2)
newdf <- data.frame(measure=rep(c("Share of Market Capitalization", "Share of Earnings"),11),
sector=rep(c("Consumer Discretionary", "Consumer Staples",
"Energy", "Financials", "Health Care","Industrials","Materials",
"Real Estate", "Technology","Communication Services",
"Utilities"), each=2),
percentage=c(11, 4, 7, 9, 2, -4,10,15,14,25,8,2,3,3,3,3,28,27,11,12,3,4))
p1<-ggplot(data=newdf, aes(x=reorder(sector,percentage), y=percentage, fill=measure)) +
geom_bar(stat="identity", position=position_dodge())+
geom_text(aes(label=percentage), vjust=-0.25,
position = position_dodge(0.9), size=3.5)+
scale_fill_brewer(palette="Paired")+
theme_minimal()+
labs(title = "Share-weighted percentages of S&P by sector, 2020 Q2",
y = "Percentage",
x = "Market sectors")+
theme(legend.position="top")+
theme(axis.text.x=element_text(angle=45,hjust=1))
p1
Data Reference
The following plot fixes the main issues in the original.