To read about the issues and how they were rectified, Click the Original, Code and Reconstruction tabs.

Original Visualization


Source: Tactics Board: How India can beat Australia (2019)


Objective

The original data visualization’s objective is to compare the batting averages and dismissal rates of Indian batsmans against left-arm pace bowler Mitchell Starc and the targeted audience could be Indian batsmans to test their averages vs left-arm pace bowler Mitchell Starc.

The visualization chosen had the following three major issues:

  • The Y-axis scale does not correspond to the averages and dismissals indicated in the graph.
  • The information on the graph is concealed as the graph utilized Indian batsman’s images instead of bars.
  • There is some ambiguity in the representation of dismissals and batting averages.

Reference

Code

The code below was used to address the issues identified in the original visualization:

library(ggplot2)
library(colorspace)
library(tidyverse)

data1 <- data.frame(Openers = c("V.Kohli", "K.Jadhav" ,"R.Sharma", "S.Dhawan", "M.S.D"), Averages = c(100,62,51.9,34.4,24.77))
data2 <- data.frame(Openers = c("V.Kohli", "K.Jadhav" ,"R.Sharma", "S.Dhawan", "M.S.D"),Dismissals = c(05, 01, 10, 12, 09))

D1<- ggplot(data1, aes(x=Openers, y=Averages,fill=Openers)) + geom_bar(stat="identity", colour="black", width=0.5) + scale_fill_brewer(palette="Set1") + ggtitle("Indian Batsman batting average since world cup 2015") + xlab("Indian Batsmans") + ylab("Batting Average") + geom_text(aes(label=Averages), vjust=-0.2, size=4.5)

D2<- ggplot(data2, aes(x=Openers, y=Dismissals,fill=Openers)) + geom_bar(stat="identity", colour="black", width=0.5) + scale_fill_brewer(palette="Set2") + ggtitle("Indian Batsmans Dismissals since world cup 2015") + xlab("Indian Batsmans") + ylab("Dismissals") + geom_text(aes(label=Dismissals), vjust=-0.2, size=4.5)

Data Reference

Reconstruction

The following plot corrects the major issues in the original visualisation: