I'd like to figure out how to left justify the following multiline text element within a ggplot2
plot:
library(tidyverse)
tibble(x = 1, y = 1) %>%
ggplot(aes(x, y)) +
geom_text(
label =
"line 1 is this long
line 2 is longer than line 2
line 3 is short"
)
Created on 2021-03-25 by the reprex package (v0.3.0)
Although I've been able to alter the relative alignment between the lines in various ways (for example, by inserting spaces or using paste()
), I haven't been able to left justify them.
Any non-hacky solution would be welcome, whether or not it uses geom_text()
!