Script Use of Lexicometry in Sensometrics

Figure 8. Representation of the groups

plot.MFA(res.mfact.23,choix="group",invisible=c("col"),cex=0.8, col.hab="black",
title="Representation of the judges-groups",palette=gray(c(0.2,0.2)), graph.type="classic" )

 

To build a plot with colours:

 

Coord.Fig8 <- as.data.frame(res.mfact.23$group$coord)
Coord.Fig8

 

Coord.Fig8$type <- 1 # French by default
Coord.Fig8$type[15:23] <- 2 # Catalan judges
df.ilustrat <- as.data.frame(res.mfact.23$group$coord.sup)
df.ilustrat$type <- 3 # Liking score
Coord.Fig8 <- rbind(Coord.Fig8, df.ilustrat)
Coord.Fig8$type <- as.factor(Coord.Fig8$type)
Coord.Fig8

col1gr <- c("white", "black", "#33CC33") # Background colours French, Catalan, Scores
col2gr <- c("red", "white", "white") # Word colours French, Catalan, Scores
set.seed(12345)
Figure8 <- ggplot(Coord.Fig8, aes(x=Dim.1, y=Dim.2, label = rownames(Coord.Fig8)))+
theme_classic()+ coord_fixed()+
geom_hline(yintercept=0, linetype="dashed", color = "grey")+
geom_vline(xintercept=0, linetype="dashed", color = "grey")+
geom_label_repel(size=5, fontface = "bold", max.overlaps=44,
box.padding = unit(0.35, "lines"),
aes(x=Dim.1, y=Dim.2, label = rownames(Coord.Fig8), fill = type, color=type))+
labs(x=labx)+labs(y=laby)+
theme(axis.title.x= element_text(size=17, face="bold"))+
theme(axis.title.y= element_text(size=17, face="bold"))+
theme(axis.text.x = element_text(size=rel(1.6)))+
theme(axis.text.y = element_text(size=rel(1.6))) +
theme(plot.margin = grid::unit(c(t=5,r= 2,b=3, l=2), "mm"))+
scale_fill_manual(values = setNames(col1gr, levels(Coord.Fig8$type))) +
scale_color_manual(values = setNames(col2gr, levels(Coord.Fig8$type)))+
ggtitle("Figure 8. Representation of the judges-groups")+
theme (legend.position="none")+
theme(axis.title.x = element_text(margin=margin(t=10))) +
theme(panel.border = element_rect(colour = "black", fill=NA, linewidth=1))
Figure8