如果你没有
需要
使用
cowplot
(它解决的大多数缺陷现在都是
ggplot2
),这里有一个解决方案:
df <- cbind(fct = rep(c('z1', 'z2', 'z3'), each = 100),
val = rbind(x_1, z2 = x_2, z3 = x_3))
ggplot(df) +
geom_histogram(aes(x = val)) +
facet_wrap(vars(fct), nrow = 3) +
labs(x = "X LAB", y = "Y LAB", title = "test") +
theme(strip.background = element_blank(),
strip.text = element_blank(),
plot.title = element_text(hjust = 0.5))