我有几个ggplots
组合使用的图表patchwork
。我制作了一个ggplot
仅由 y 轴组成的。这工作正常,但各个方面没有对齐。关于如何使刻面具有相同大小并相互高于的任何想法?
这是拼凑代码:
y_axis + decreasers_p+late_bloomers_p + o2_lovers_p + solo_riders_p + plot_layout(widths = c(1, 10),
guides = "collect",
design =
"12
13
14
15")
这是一些ggplot代码:
solo_riders_p <- ggplot(solo_riders, aes(x=days_incubated, y=emission))+
geom_point(aes(shape=compound, size=compound, fill=compound)) +
scale_shape_manual(values=c(21, 25))+
scale_size_manual(values=c(2.8, 2.5))+
scale_fill_manual(values=c("black", "grey"))+
labs(fill = "Compound", shape = "Compound", size = "Compound",
x = "Incubation time (days)",
y = "BVOC emission (nmol g-1 loi soil h-1)",
title = "solo_riders") +
theme_bw() +
facet_wrap(vars(jar), scales = "free_y")
y_axis <- ggplot(data.frame(l = decreasers_p$labels$y, x = 1, y = 1)) +
geom_text(aes(x, y, label = l), angle = 90) +
theme_void() +
coord_cartesian(clip = "off")
这是我希望的示例(但每行上方没有标题):