11.4 Changing the Appearance of Facet Labels and Headers
11.4.2 Solution
With the theming system, set strip.text
to control the text appearance and strip.background
to control the background appearance (Figure 11.6):
library(gcookbook) # Load gcookbook for the cabbage_exp data set
ggplot(cabbage_exp, aes(x = Cultivar, y = Weight)) +
geom_col() +
facet_grid(. ~ Date) +
theme(
strip.text = element_text(face = "bold", size = rel(1.5)),
strip.background = element_rect(fill = "lightblue", colour = "black", size = 1)
)