如何更改ggplot2 R中stat_poly_eq的字体大小

Bio*_*eek 3 size fonts r ggplot2

我有一个 ggplot 存储在 say 中p,希望添加一个poly_stat_eq图层来显示曲线方程。我想更改文本的字体大小,但找不到有关如何实现它的文档

p + 
  stat_poly_eq(formula = y ~ x, 
               aes(label = paste(..eq.label.., ..rr.label.., sep = "~~~")),
               label.x = 4, label.y = -5, parse = TRUE) 
Run Code Online (Sandbox Code Playgroud)

Obe*_*Obe 5

您只需设置即可size = some real number。在你的情况下,这看起来像

 p + 
  stat_poly_eq(formula = y ~ x, 
               aes(label = paste(..eq.label.., ..rr.label.., sep = "~~~")),
               label.x = 4, label.y = -5, parse = TRUE, size = 2.4) 
Run Code Online (Sandbox Code Playgroud)

只需将后面的数字更改size =为您想要的任何数字即可。附加ggpmisc示例页面也是一个值得查看的好地方。您可以在这里找到 。我希望这有帮助。