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

Original


Source: Ada Derana Lunch Time news 2020-04-18


Objective

Targetted audience of this visualisation is all the Sri Lankan news viewres particulary of this TV channel. The objective of this visualisation is to explain the weekly comparison of newly infected COVID-19 patients in Sri Lanka.

The visualisation chosen had the following three main issues:

  • Inconsistent scaling of x-axis. In this data visualisation, in the x-axis fist 5 bars are plotted for weeks and from April 15th onwards the bars are plotted for each day. This will be confusing and misleading the audience.

  • Manipulating the y-axis. As the scale of y-axis is anappropriate to the data, the viewers can’t see the change over time clearly without the counts given on top of each bar.

  • No labels on both axis.

Reference

Code

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

library(ggplot2)
library(forcats)
library(dplyr)
sl_corona <- data.frame(Week = c( "Mar 11-17", "Mar 18-24", 
                                  "Mar 25-31","Apr 1-7", "Apr 8-14","Apr 15-21"),
                      Count = c(42, 59, 41, 43,48,77))


p1 <- sl_corona %>% 
  mutate(Week = fct_relevel(Week, "Mar 11-17", "Mar 18-24", 
                                  "Mar 25-31","Apr 1-7", "Apr 8-14","Apr 15-21")) %>%
  ggplot(aes(x = Week, y = Count)) 
p1 <- p1 + geom_bar(stat = "identity",color='skyblue',fill='steelblue')

As it is a time series data, to show the trends over time more clearly, line charts is better than bar chart. The following code was used to fix the issues identified by ploting them in a line chart.

p2 <- sl_corona %>% 
  mutate(Week = fct_relevel(Week, "Mar 11-17", "Mar 18-24", 
                                  "Mar 25-31","Apr 1-7", "Apr 8-14","Apr 15-21")) %>%
  ggplot(aes(group = 1, x = Week,y = Count))

p2 <- p2 + geom_line(stat = "identity", colour = "turquoise3") + geom_point(colour = "turquoise3") + 
  geom_text(aes(label = paste(Count,sep="")),nudge_y = -2, nudge_x = .05) +
  labs(
    title = "Weekly Count of Sri Lankan COVID-19 New Cases",
    y = "Number of New Cases") + theme_minimal() + scale_y_continuous(limits = c(0,80))

Data Reference

Worldometers.info. 2020. Sri Lanka Coronavirus: 835 Cases And 9 Deaths - Worldometer. [online] Available at: https://www.worldometers.info/coronavirus/country/sri-lanka/ [Accessed 1 May 2020]. Hpb.health.gov.lk. 2020. Coronavirus (COVID-19) Sri Lanka - Analytics Dashboard. [online] Available at: https://hpb.health.gov.lk/covid19-dashboard/ [Accessed 1 May 2020].

Reconstruction

The following plots fix the main issues in the original.