'Spiral bar graph using ggplot2

I'm trying to replicate this plot, particularly the spiral bar chart for INDUSTRIAL. Any idea how to do this using ggplot2? enter image description here

Thanks in advance!



Solution 1:[1]

As others have pointed out, this is so specific (and so against modern data visualization best practices), that Photoshop is probably the best tool for the job. That said, here's a version that chops up the longest bar into multiple pieces. Not a spiral, but the same basic idea of collapsing a disproportionately large y-axis value by letting it move across the x-axis.

library(tidyverse)

df <- data.frame(
  vocation = c('business', 'classical', 'industrial'),
  enrollment = c(12, 98, 2252)
)

max.bar.size <- 600
df.cut <- df %>% 
  group_by(vocation) %>% 
  summarize(
    bar = 1:(floor(enrollment / max.bar.size) + 1),
    enrollment = c(rep(max.bar.size, floor(enrollment / max.bar.size)), enrollment %% max.bar.size)
  ) %>% 
  mutate(bar = as.character(bar))

ggplot(data = df.cut, aes(x = vocation, y = enrollment, group = bar)) +
  geom_col(position = position_dodge2(preserve = 'single'))

enter image description here

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 jdobres