删除 PCA fviz_pca_biplot 中点的 ID 样本,同时保留向量上的标签

问题描述 投票:0回答:0

我正在用

fviz_pca_biplot
做 PCA 并想删除我的点的 ID 以使 PCA 更清晰。我想保留我的矢量标签。

删除ID应该用什么命令?

这是我的代码和结果。

pca_biplot = fviz_pca_biplot(res.pca, repel = TRUE, max.overlaps=Inf,
               col.var = "#000000", # Variables color #colour of the lines
               #colour = Population, #sets the colour of the data to be determined by population
               axes = c(3, 4), # choose PCs to plot
               habillage = data$Population,
               col.ind = "#696969", #colour of points
               labels=NULL
               )

pca_biplot + 
  labs(title ="ACP", x = "CP3 (15,3%)", y = "CP4 (9,6%)") + 
  scale_color_manual(values = c("blue","red")) + 
  theme_minimal() 

我也写了更详细的图例,但我无法删除初始标签。我打算简单地用白色方块遮住它,但是有没有办法只保留我定制的图例?

r ggplot2 label pca ggbiplot
© www.soinside.com 2019 - 2024. All rights reserved.