This is part-2 to my previous question (getting constant text size while using atop function in r).
Now the issue relates to how I can prevent plotmath
from centering the text to avoid the extra spacing (highlighted here in yellow). I want everything aligned to the right side of the plot.
(Unfortunately, I can't replace substitute
with expression
if that's what your suggestion is going to be.)
Any suggestions?
library(ggplot2)
ggplot(iris, aes(Species, Sepal.Length)) +
geom_boxplot() +
labs(caption = substitute(atop(
atop(
displaystyle("layer1 is small"),
displaystyle("layer2 is a bit longer")
),
"layer3 is super-duper longgggggggg"
)))