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

Original


Source: Visibility in Traffic (2021).R/dataisugly/.


Objective Different light have different wavelength and thus lights with higher wavelength travel further. This is important when drivers shares road with the cyclists and particularly to understand which colour is better visible to the drivers during night time. This data visiualization created aims to portray the proportion of visibility of cyclists wearing different colours of clothing to drivers in vehicle during night time. This visualisation is created targeting both drivers and cyclists who shares roads together.
However, the visualisation chosen had the following three main issues:

  • The layout is vague, two cars positioned on top of one another which makes the reader to think there is a comparison between the top and bottom action.
  • The visualization is not labelled well. A beam is stretching along the cyclists making the reader to think that the context is about the beam quality of the vehicle
  • common fate is displayed hence reader is distracted from the main context of light visibility, rather it draws their attention on finding similarity between objects who are running in the same direction

Reference

Code

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

library(ggplot2)
library(dplyr)


##data 
Lights = c("Black", "BLue", "Red", "Yellow", "White", "Green")
Vision = c(0, 55, 79, 121, 180, 426)
Visibility <- data.frame(Lights,Vision)


p1<-ggplot(Visibility, aes(x = reorder(Lights, Vision), y = Vision)) +
  #plotting bars
  geom_bar(stat = "identity", aes(fill = factor(Vision))) + 
  #colouring each bars with their equivalent visiblity colour
  scale_fill_manual(values = c('black', 'blue', 'red',
              'yellow', 'white', 'green')) + 
  ##adding sub text into bars and hence removing legend 
  geom_text(aes(label = Vision), vjust = 0) + guides(fill = FALSE) +
  

  

##removing background noise
    theme(
    plot.background = element_blank(),
    panel.grid.major = element_blank(),
    panel.grid.minor = element_blank(),
    panel.border = element_blank()
  ) +
  
  
  

##labelling the bar chart  
  xlab("colours") + ylab("Visibility Range (ft)") + labs(title = " Different colour visiblity to drivers",)

Data Reference

Reconstruction

The following plot fixes the main issues in the original.