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

Original


Source: https://www.studioterp.nl/a-view-on-despair-a-datavisualization-project-by-studio-terp/

Objective

The data visualization aims to make people aware of most frequent methods of suicides in Netherlands. It also shows what are the most common age groups committing suicides. This is a grim issue and it can help government in preventing suicides and providing mental help to people showing signs of depression.

The chosen visualisation had the following three main issues:

  • Although the visualization is visually appealing but the marks are so far apart that a visual comparison can not be made between methods of suicide, this is because of the resolution of the visualization.
  • If you look closely at the visualization, the marks are slightly different within each method of suicide representing different age groups. The choice of markers support the overall look of the visualization but are not clear enough to the viewers.
  • Taking nothing away from the beauty of the visualization, but because of extensive use of background colors, the methods ‘Hanging / strangulation’ and ‘Train / metro’ pop out, rest of the methods just blend in to the visualization.

Reference

Code

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

## Loading required libraries for loading data and creating visualization
library(ggplot2)
library(readxl)

## Reading Data
Suicides_data <- read_excel("Suicides_data.xlsx")

## Converting age groups to ordered factors - ordered from youngest to oldest
Suicides_data$age_group_in_years <- factor(Suicides_data$age_group_in_years,
                                  levels = c('< 20', '20 - 29', '30 - 39',
                                             '40 - 49', '50 - 59', '60 - 69',
                                             '70 - 79', '>= 80'),
                                  ordered = TRUE)

## Creating the plot
plot <- ggplot(data = Suicides_data, aes(x = reorder(method, -suicides), y = suicides,
                                         fill = age_group_in_years))

## Adding color scheme to bar bar plot
plot <- plot + geom_col(position = 'dodge') + scale_fill_brewer()

## positioning color legend and tilting the x-axis labels for clearity
plot <- plot + theme(legend.position="top", axis.text.x = element_text(angle = 45, hjust = 1),
                     plot.title = element_text(hjust = 0.5))

## Giving a title to plot and axes
plot <- plot + labs(title="Methods of suicide in Netherlands (2017)", x ="Method of suicide", y = "Number of suicides")

Data Reference

Reconstruction

The following plot fixes the main issues in the original plot.

  • Now we can clearly see Hanging / strangulation is the most frequent method of suicide.
  • Within each method of suicide, which age group is most frequent.