library(ggplot2)
iris$is_pretty <- sample(c(TRUE, FALSE), nrow(iris), replace = TRUE)
# dodge < width
ggplot(iris, aes(y = is_pretty, x = Petal.Length, fill = Species)) +
geom_bar(stat = "identity", position = position_dodge(0.5), width = 0.85)
# dodge = width
ggplot(iris, aes(y = is_pretty, x = Petal.Length, fill = Species)) +
geom_bar(stat = "identity", position = position_dodge(0.5), width = 0.5)
# dodge > width
ggplot(iris, aes(y = is_pretty, x = Petal.Length, fill = Species)) +
geom_bar(stat = "identity", position = position_dodge(0.85), width = 0.5)
Created on 2020-09-09 by the reprex package (v0.3.0)