r - Is there a way to increase the height of the strip.text bar in a facet? -
i grey bar @ top wider, in, have edges of little further top , bottom of letters (the strip.text - a, b, c etc). have thought lineheight have acted padding 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 levels include linebreak:
levels(diamonds$color) <- paste0(" \n", levels(diamonds$color) , "\n ")
then adjust 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))
Comments
Post a Comment