I want to put black borders with labels and titles around each facet in facet_wrap
.
Something similar to this:
Sample data:
library(tidyverse)
mtcars %>%
mutate(gear = factor(gear, levels = c(4, 3, 5))) %>%
ggplot(aes(mpg, disp)) +
geom_point() +
geom_smooth(method = "lm") +
facet_wrap(~am + gear)
You can do this by manually adding to the ggplot
gtable
: