我在 R 中使用 ggplot 创建了以下图:
代码:
ggplot(hola, aes(.fitted, .resid, color=type)) +
geom_point() +
geom_hline(yintercept = 0, color="black") +
geom_smooth(se = FALSE, color="darkblue")+facet_wrap( type~exp, scales = "free") +
scale_color_manual(values=c("#5fb772", "#5fabb7"))
Run Code Online (Sandbox Code Playgroud)
然而,我认为facet_wrap标签看起来太大并且破坏了整体图形的外观;有没有办法以更好看的方式显示它?就像将 df 的两列合并为一列?或将面标签合并在一行中?
PD:顺便说一下,使用facet_grid 不是一个选项,因为mu 和abs 的X 轴是不同的。