owenqi 发表于 2021-5-27 10:05 
我给你的例子不就是你所谓的半透明椭圆吗?
老师请问 我输入了你提供的代码,为什么椭圆置信区间的色彩部分正常,但看不到边框呢?修改很多次也没有解决问题麻烦了
autoplot(pca1, data = iris, col= "Species", size=2, shape = "Species",
loadings = TRUE, loadings.colour ='blue',
frame = FALSE,
loadings.label = TRUE, loadings.label.size =3,
label = FALSE, label.size = 3, axes = F) +stat_ellipse(aes(fill=iris$Species), type = "norm", geom ="polygon", alpha=0.2, level=0.95, show.legend = FALSE, linetype = 'dashed', size=3)+geom_hline(yintercept = 0 , linetype = 'dashed', size = 0.5) +
geom_vline(xintercept = 0 , linetype = 'dashed', size = 0.5) +
scale_x_continuous(limits = c(-0.2, 0.2), breaks=seq(-0.2, 0.2, 0.1))+
scale_y_continuous(limits = c(-0.3, 0.3), breaks=seq(-0.3, 0.3, 0.15)) + theme(panel.border = element_blank(), axis.ticks.length=unit(-0.18, "cm"))