Stack Exchange
Line spacing for wrapped text in ggplot
I need to change the line spacing in wrapped geom_text layer.
library(ggplot2)
library(stringr)
txt = c('one two three', 'four five six', 'seven eight nine')
p = ggplot(data=NULL, aes(x=1:3, y=1:3, label = str_wrap(txt, width = 3))) + 
  geom_text() + expand_limits(x = c(0.5, 3.5), y = c(0.5, 3.5))


But theme(text=element_text(lineheight = ...)) has no effect because theme only works for non-data components of the plot, so I'm not clear how to achieve this. Suggestions?

Just use lineheight, e.g.:
ggplot(data = NULL, aes(x = 1:3, y = 1:3, 
                        label = str_wrap(txt, width = 3))) + 
  geom_text(lineheight = .5) + 
  expand_limits(x = c(0.5, 3.5), y = c(0.5, 3.5))

(s. ?geom_text)


Well duh! There's a lesson to read the full doc page not just the function spec.
