由于factoextra
使用ggplot2
绘图系统,是否有办法调整文本标签(抖动)的位置,以避免重叠?
# install.packages("devtools","FactoMineR")
# library("devtools")
# install_github("kassambara/factoextra")
library("FactoMineR")
library("factoextra")
data(poison)
poison.active <- poison[1:55, 5:15]
res.mca <- MCA(poison.active, graph = FALSE)
fviz_mca_ind(res.mca)
答案 0 :(得分:2)
论据 jitter 现在可以在factoextra包中找到,并记录在:http://www.sthda.com/english/wiki/factoextra-reduce-overplotting-of-points-and-labels-r-software-and-data-mining。
安装最新版本的factoextra(&gt; = 1.0.3),如下所示:
# install.packages("devtools")
devtools::install_github("kassambara/factoextra")
library("FactoMineR")
library("factoextra")
# Load data
data(poison)
poison.active <- poison[1:55, 5:15]
# Compute MCA
res.mca <- MCA(poison.active, graph = FALSE)
# Default plot
fviz_mca_ind(res.mca)
Use jitter to reduce overplotting
fviz_mca_ind(res.mca, jitter = list(width = 0.3, height = 0.3))
请注意,参数抖动是宽度和高度参数的列表: