I am currently using ggplot2 and the annotation function, an example from the documentation is given below. I have a limited width to annotate text of unknown length and need an automatic way to wrap it within the x_start and x_end . Since I do not want to change the font size, I will also need to shift the y value depending on how many gaps are entered. Is there an easy way to do this?
# install.packages(c("ggplot2"), dependencies = TRUE) require(ggplot2) p <- ggplot(mtcars, aes(x = wt, y = mpg)) + geom_point() p + annotate("text", x = 4, y = 25, label = "Some arbitrarily larger text")
source share