It seems that
vjust options in
annotate() do not work if the text label includes plotmath expressions. Below is the sample code.
library(tidyverse) library(ggplot2) test_data = tibble(x=1:100,y=100:1) ggplot(test_data, mapping=aes(x=x, y=y)) + geom_point() + annotate(geom = "text", x = 100, y = 100, hjust = 1, vjust = 1, label = expression(atop(1+1==2, italic("hjust does not work correctly"))))
Below is the output of the sample code.
What I want is to locate each line of the label to the rightmost position of the plot. Is there any way to do this?