# ===========================================
# Figura 2
# Calidad global por modalidad experimental
# ===========================================

# Instalar paquetes si es necesario
# install.packages("ggplot2")

library(ggplot2)

# ==========================
# Base de datos
# ==========================

datos <- data.frame(

Modalidad = c(

rep("Sin posedición",9),
rep("Posedición cruzada",9),
rep("Chatbot + guía EFE",9),
rep("Posedición humana",9)

),

Media = c(

5.00,
4.00,
3.00,
5.00,
4.20,
4.20,
3.80,
3.60,
3.20,

5.00,
3.94,
5.00,
5.00,
5.00,
5.00,
5.00,
3.86,
5.00,

5.00,
4.90,
4.60,
5.00,
5.00,
5.00,
5.00,
5.00,
5.00,

3.30,
3.30,
3.90,
3.30,
3.20,
4.00,
3.00,
3.40,
3.40)

)

# ==========================
# Orden de los factores
# ==========================

datos$Modalidad <- factor(
datos$Modalidad,
levels=c(
"Sin posedición",
"Posedición cruzada",
"Chatbot + guía EFE",
"Posedición humana")
)

# ==========================
# Figura
# ==========================

p <- ggplot(datos,
aes(x=Modalidad,
y=Media,
fill=Modalidad))+

geom_boxplot(
width=.55,
alpha=.70,
outlier.shape=NA,
colour="grey20",
linewidth=.5)+

geom_jitter(
width=.12,
size=2.6,
shape=21,
stroke=.4,
colour="black",
fill="white")+

scale_fill_manual(values=c(
"#8DA0CB",
"#66C2A5",
"#FC8D62",
"#B3B3B3"
))+

labs(

title="Figura 2",
subtitle="Distribución de la calidad traductora según la modalidad experimental",

x="Modalidad experimental",

y="Media global (escala 1–5)"

)+

coord_cartesian(ylim=c(2.8,5.2))+

theme_classic(base_size=13)+

theme(

legend.position="none",

plot.title=element_text(
face="bold",
size=15),

plot.subtitle=element_text(
size=11),

axis.title=element_text(
face="bold"),

axis.text.x=element_text(
size=11),

axis.text.y=element_text(
size=11)

)

print(p)

# ==========================
# Exportación
# ==========================

ggsave(
"Figura2_Boxplot.png",
plot=p,
width=8,
height=6,
dpi=600,
bg="white"
)

ggsave(
"Figura2_Boxplot.pdf",
plot=p,
width=8,
height=6,
bg="white"
)

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: