The Eurofound publication “Working conditions and job quality: Comparing sectors in Europe”" (2014, full text) has a nice scatterplot (pg. 33) showing the average levels of job intensity and job autonomy on the sector level.

Unfortunately, the resolution and readabilty of that specific scatterplot is terrible. It is also not clear why each sector need to have a different symbol, resulting in a cluttered look.

Eurfound scatterplot strain sectors

I needed a graph to illustrate the quality of labor preformed in the transport sector, so remade the scatterplot in R. With WebPlotDigitizer it is easy to extract the values of the points, and turn it into a CSV-file.

The code below demonstrates the ggplot2-library, together with the ggthemes and ggrepel library. This last library is handy when trying to get text labels arranged without having to rely on manual (re-)adjustments. It automatically repels labels you add to plots so that they don’t overlap. Not always perfect, but it beats manually moving them around, esp. if you expect multiple iterations or need something fast.

Setup

# load required ggplot-libraries
library(ggplot2)
library(ggrepel)
library(ggthemes)
strain.sector <- read.csv2('https://git.io/v2lGL')
dim(strain.sector)
## [1] 32  3

We have the work intensity and job autonomy scores for 32 sectors, together with the sector labels.

# Select one or more sectors to highlight,
#   in this case the transport sector
strain.sector$highlight <- ifelse(
  strain.sector$sector_label == 'Transport and storage',
  TRUE, FALSE)
# define some colors
hiva.oranje.donker <- '#F67504'
hiva.oranje.licht <- "#fc9e49" # officieel
hiva.grijs <- 'grey60'
hiva.groen.licht <- "#bad80a"
hiva.groen.donker <- "#8EA608"
hiva.contrast <- c(hiva.grijs, hiva.oranje.donker)

Construct scatterplot

p <- ggplot(strain.sector, aes(
  x=work_intensity, 
  y=job_autonomy, 
  group=highlight, 
  color=highlight))
# Add lines voor medians, constructing quadrants 
p <- p + geom_hline(yintercept=60, colour=hiva.grijs) + 
  geom_vline(xintercept=37, colour=hiva.grijs)

# Add points 
p <- p + geom_point(size = 5, color='grey80')
p

# Add boxed labels with repel-functionality
set.seed(42) # set a reed to get the same label-placement
p <- p +   geom_label_repel(
  aes(
    fill = highlight, 
    label = sector_label),
  fontface = 'bold', color = 'white',
  size = 2,
  box.padding = unit(0.25, "lines"),
  point.padding = unit(0.5, "lines")
)
p

The default colors are not that terribly interesting, as I don’t want to make a contrast but hightlight a single sector. I use scale_colour_manual() to set a grey color for all the sectors except for one.

# set grey/orange colors for labels
p <- p + scale_colour_manual(values = hiva.contrast) + 
  scale_fill_manual(values = hiva.contrast)

# add titles and annotation for the median lines
p <- p + labs(
  title='Labor in the transportation sector is on average some of the most\n strained work: high intensity, low autonomy (Eurofound, EWCS 2010)',
  x='Work intensity', y='Job\nautonomy')

p <- p + annotate('text', 
                  label='EU median', 
                  x=34.5,y=43, color=hiva.grijs)

p <- p + annotate('text', 
                  label='EU median', 
                  x=26,y=59, color=hiva.grijs)

p

The goal of the graph is to quickly hightlight the position of the transportation sector, compared to the other sectors. The exact values on the job autonomy and work intesity indices are not that terribly relevant. So we use the minimalist Tufte theme in ggthemes, dropping the grey background and white gridlines. We also don’t need the legend on the right.

In the end we only keep a few axis tick marks with values to indicate the x and y scales, and the two median lines suggesting quadrants. This is suffiencent for a plot in a Powerpoint, where the viewer only needs to pick up on the overal position of the transportation sector without being distracted by other things in the graph.

# Small extention to the Tufte theme provided by ggthemes:
#  rotate the y-axis label horizontally, so it can be read in a glance
p <- p + theme_tufte() + theme(
  axis.title.y = element_text(vjust=1, angle=0, hjust=1),
  legend.position='none')

Final plot

# uncomment if you want to save a PNG
# ggsave('Eurofound_sector_autonomy_intensity_2014_remake.png', p)
p