rggplot2factoextra

factoextra: jitter labels to avoid overplotting


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)

Solution

  • 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:

    enter image description here