我正在创建一个箱线图,如下所示
result = ggplot(
data = data,
aes(
x = reorder(c, c_num),
y = total,
fill =paste(m, co),
group = c
)
) +
geom_boxplot(lwd=0.8, position=position_dodge2(width=0.5, preserve="single")) +
scale_x_discrete() +
facet_wrap(m ~ co, nrow = 1, scale = "free_x") +
但看起来
preserve="single"
当镶嵌面组中的条件数为1时无效。
有没有办法防止这种情况?