0

I want to add label in ggplot2 through function annotate.

Before I done this by annotate(... label = "a"~'='~100~t~y^-1",...). Now I use letter 'df' to represent 100, and the code is label = paste("atop('a = '*", df,")"). Is there any way to add unit?

annotate("text",
     x = 0, y = 1.2,
     size = 12,
     parse = TRUE,
     # label = "a~'='~100~t~~y^-1",
     label = paste("atop('a = '*", df,")"),
     family = "serif")+
stefan
  • 90,330
  • 6
  • 25
  • 51
Guo DJ
  • 1
  • Perhaps you want `label = paste("atop(a~'='~", df, "~t~~y^-1", ")")`? For more help please provide [a minimal reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) including a "working" code which others could run. – stefan Aug 04 '23 at 05:56

0 Answers0