3

I have a ggplot stored in say p and wish to add a poly_stat_eq layer to display the equation of the curve. I want to change to font size of the text but I'm unable to find a documentation on how to achieve it

p + 
  stat_poly_eq(formula = y ~ x, 
               aes(label = paste(..eq.label.., ..rr.label.., sep = "~~~")),
               label.x = 4, label.y = -5, parse = TRUE) 
Z.Lin
  • 28,055
  • 6
  • 54
  • 94
Rspacer
  • 2,369
  • 1
  • 14
  • 40

1 Answers1

5

You can just set size = some real number. In your case this would look like

 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) 

Just change the number after size = to whatever you want. The ggpmisc additional examples page is a good place to look over as well. You can find that here. I hope this helps.

abhikrroy
  • 311
  • 3
  • 8