ggpubr icon indicating copy to clipboard operation
ggpubr copied to clipboard

Using geom_text not working to add labels for the stat_mean points.

Open AtomicNess123 opened this issue 2 years ago • 0 comments

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?

AtomicNess123 avatar Aug 11 '21 08:08 AtomicNess123