1

Since factoextra uses the ggplot2 plotting system, is there a way to adjust the positioning of text labels (jitter), in order to avoid overlapping?

# 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)
StupidWolf
  • 45,075
  • 17
  • 40
  • 72
Brani
  • 6,454
  • 15
  • 46
  • 49

1 Answers1

3

factoextra: Reduce overplotting

The argument jitter is now available in factoextra package and documented at : 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")

Compute Multiple Correspondence Analysis

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

# Default plot
fviz_mca_ind(res.mca)

enter image description here

Use jitter to reduce overplotting

Use jitter to reduce overplotting
fviz_mca_ind(res.mca, jitter = list(width = 0.3, height = 0.3))

Note that the argument jitter is a list of width and height parameters:

  • width: degree of jitter in x direction
  • height: degree of jitter in y direction

enter image description here

A. Kassambara
  • 228
  • 1
  • 5
  • Thank you for your work. Just one more question. Is it possible to jitter just the text labels, without changing the correct position for points? – Brani Jul 05 '15 at 08:14
  • A bit late but see this page for jittered labels: http://www.sthda.com/english/wiki/factoextra-reduce-overplotting-of-points-and-labels-r-software-and-data-mining – J.Con Sep 27 '16 at 22:00