factoextra:抖动标签以避免过度绘制

factoextra: jitter labels to avoid overplotting

由于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)

factoextra:减少过度绘制

参数 jitter 现在可以在 factoextra 包中使用并记录在:http://www.sthda.com/english/wiki/factoextra-reduce-overplotting-of-points-and-labels-r-software-and-data-mining.

Install the latest version of factoextra (>= 1.0.3) as follow:

# 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))

注意参数 jitter 是 widthheight 参数的列表:

  • width:x方向的抖动程度
  • height: y方向的抖动程度