I would like the grey bar at the top to be wider, as in, have the edges of it a little further from the top and bottom of the letters (the strip.text - A, B, C etc). I would have thought the lineheight would have acted as padding but it doesn't.
ggplot(diamonds, aes(carat, price, fill = ..density..)) +
xlim(0, 2) + stat_binhex(na.rm = TRUE)+
facet_wrap(~ color) +
theme(strip.text = element_text(lineheight=20))
First, modify the levels so that they include a linebreak:
levels(diamonds$color) <- paste0(" \n", levels(diamonds$color) , "\n ")
Then adjust as necessary. eg:
P <- ggplot(diamonds, aes(carat, price, fill = ..density..)) +
xlim(0, 2) + stat_binhex(na.rm = TRUE)+
facet_wrap(~ color)
P + theme(strip.text = element_text(size=9, lineheight=0.5))
P + theme(strip.text = element_text(size=9, lineheight=3.0))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With