如何用fviz_pca_ind()绘图而不显示图例?

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

我想让图例消失。上面是我在R中对虹膜数据集所做的一个例子,我在fviz_pca_ind()的文档中找不到一个变量来省略图例。

library(factoextra)
library(FactoMineR)
pca_iris <- PCA(iris[ ,-5])
iris$species <- as.factor(iris$Species)
pca_n.macros_plot <- fviz_pca_ind(pca_iris, 
             pointshape = 21,habillage = iris$species,
             palette = "jco",label="none",
             geom.ind = c("point"),geom = c("point"),
             title="PCA iris")
r visualization pca
1个回答
1
投票

根据 文件 fviz_pca的。

输出类是 ggggplot. 因此,下面的代码应该对你有用。

pca_n.macros_plot + theme(legend.position = "none")
© www.soinside.com 2019 - 2024. All rights reserved.