How can I change the grey facet labels (A and B) into say red background with white text?
A = data.table(x = 1:4, y = 1:4, z = c(\'A\',\'A\',\'B\',\'B\'))
gg
For anyone else looking to change individual facet labels, there's a solution here:
g <- ggplot_gtable(ggplot_build(p))
stripr <- which(grepl('strip-r', g$layout$name))
fills <- c("red","green","blue","yellow")
k <- 1
for (i in stripr) {
j <- which(grepl('rect', g$grobs[[i]]$grobs[[1]]$childrenOrder))
g$grobs[[i]]$grobs[[1]]$children[[j]]$gp$fill <- fills[k]
k <- k+1
}
grid::grid.draw(g)