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

Original


Source: Reddit User foiltape: Blood Type Distribution in the United States


Objective

The target audiences are people who are interested in the distribution of the blood type in USA, which maybe the researcher of the blood type in USA, medical workers, or who intend to donate blood.

The visualisation chosen had the following three main issues:

  • It is a pie chart, which lacks of accuracy.
  • No labels to identify the exact proportion of each category.
  • Using of area is not easy to compare rach category.

Reference

Code

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

library(ggplot2)
library(colourpicker)
blood <- data.frame(Blood_Type = c("A+", "A-", "B+", "B-", "O+", "O-", "AB+", "AB-"),
                    Percentage = c(35.7, 6.3, 8.5, 1.5, 37.4, 6.6, 3.4, 0.6))

p1 <- ggplot(data = blood, aes(x = Blood_Type, y = Percentage, fill = Blood_Type))

p1 <- p1 + geom_bar(stat = "identity") + scale_fill_manual(values = c("#0000CD", "#BBFFFF", "#458B00", "#C1FFC1", "#CD3333", "#FFC0CB", "#FFB90F", "#FFF68F")) + labs(title = "Blood Type Distribution in the United States", x= "Blood types", y = "Proportion of each blood type") + geom_text(aes(label = paste(Percentage, "%", sep = ""), vjust = -0.1))

Data Reference

Reconstruction

The following plot fixes the main issues in the original.