Hi all,
I am working on PCA analysis and am wondering how to format the figure? For example, I use the code below to plot the figure, as shown below. How to edit the x and y axis titles? For example, I want x-axis to be PC1 instead of Dim1 (41.%), how to realize this? Second, how to remove the background grids and use a rectangular box? Thanks for your help.
library("FactoMineR")
library("factoextra")
library("corrplot")
library("corrplot")
data(decathlon2)
# It contains 27 individuals (athletes) described by 13 variables.
decathlon2.active <- decathlon2[1:23, 1:10]
head(decathlon2.active[, 1:6], 4)
res.pca <- PCA(decathlon2.active, graph = FALSE)
print(res.pca)
fviz_eig(res.pca, addlabels = TRUE, ylim = c(0, 50))
# plot the variables
fviz_pca_var(res.pca, col.var = "black")