Is it possible to have multiple font sizes in a facet strip? I would like to have a larger font size for the variable in the facet_grid
, then a smaller font size for some other text (e.g. sample size). I haven't found a way to do this using strip.text
. Is a labeller function needed?
Here is some example data:
data <- as.data.frame(matrix(rnorm(60),20,3))
data$veg <- c(rep("Tree (n=2)", 4),rep("Bush (n=4)", 4),rep("Shrubbery (n=6)", 4), rep("Aquatic (n=2)",4),rep("Control (n=7)", 4))
names(data) <- c("A", "B", "C", "veg")
melted <- melt(data)
ggplot(melted, aes(variable, value)) +
geom_point()+
facet_grid(~veg)+
theme(strip.text.x = element_text(size = 14))
In the example below I would like "Aquatic" to be size 14 font and "(n=2)" size 10.
These same font sizes would be applied to all the factors of veg.