On occasion, I have the need for some kind of pattern or textures for geom_bar() / geom_col() bars (i.e., for black-and-white printing). For example, the following can be hard for some people to view:
library(ggplot2) library(dplyr, warn.conflicts=FALSE) library(tidyr) d <- iris %>% group_by(Species) %>% summarize_all(mean) %>% gather(key, val, -Species) ggplot(d, aes(x = Species, y = val, fill = key)) + geom_col(position = "dodge") + scale_fill_grey()
There have been good questions and answers on Stack Overflow (also here, but the solutions are complicated and basically involve creating the patterns or textures by hand. I’m wondering if anyone has general ideas or suggestions or new approaches to solving this problem in a different way. Oftentimes when I think I can’t do something with ggplot2, it means changing how I think about addressing it - but other (rare) times it just isn’t implemented yet!