I have an issue with wrapping long texts in ggplot2. Similar question was asked here ggplot2 is there an easy way to wrap annotation text?
My question is if we have the text like this
my_label <- "Some_arbitrarily_larger_text"
How can we shrink it using the same method ?
wrapper <- function(x, ...) paste(strwrap(x, ...), collapse = "\n")
library(ggplot2)
ggplot(mtcars, aes(x = wt, y = mpg)) + geom_point()+
annotate("text", x = 4, y = 25, label = wrapper(my_label, width = 5))
It seems not working for this case!

