ggpubr
ggpubr copied to clipboard
Using geom_text not working to add labels for the stat_mean points.
In this example:
library(ggpubr)
df <- mtcars
df$cyl <- as.factor(df$cyl)
# Scatter plot with ellipses and group mean points
ggscatter(df, x = "wt", y = "mpg",
color = "cyl", shape = "cyl", ellipse = TRUE)+
stat_mean(aes(color = cyl, shape = cyl), size = 4)
How to use geom_text() to add labels for the mean points in stat_mean?