# install.packages("ggplot2")
# install.packages("ggalt")
# OR: devtools::install_github("hrbrmstr/ggalt")
library(ggplot2)
library(ggalt)
gg <- ggplot(mpg, aes(displ, hwy)) +
geom_point(aes(color = manufacturer)) +
geom_encircle(aes(group = manufacturer, fill = manufacturer),
alpha = 0.2, show.legend = F) +
theme_classic()
gg
可用于PCA,PCoA等