2

Coming from this example:

df <- data.frame(TYPE = c("A", "B", "C", "D", "E", "F"), VALUE = c(10, 11, 9, 12, 10, 8))
ggplot(df, aes(x = TYPE, y = VALUE)) + geom_bar(stat = "identity")

Is it possible to add a space in a bar chart after every X bars? In this code maybe after every second bar (so that there is a space between B/C and D/E, but not between the others).

Threads I found on SO focused on adding spaces between all bars.

Adding space between bars in ggplot2

How to increase the space between the bars in a bar plot in ggplot2?

Felix Grossmann
  • 1,224
  • 1
  • 11
  • 30

0 Answers0