[英]How to center ggplot figure in R
Is there a way to center the "Open Tray" figure in the bottom row?有没有办法将底行的“打开托盘”图形居中?
I am trying to use sfplot <- ggarrange(Cf, Ff, Of, labels = c("A", "B", "C"))
, but obviously it won't automatically center it.我正在尝试使用
sfplot <- ggarrange(Cf, Ff, Of, labels = c("A", "B", "C"))
,但显然它不会自动居中。 Thanks in advance!提前致谢!
If you wanted to use ggarrange
, then you can nest each row of plots within another ggarrange
(though this is obviously more verbose than just using patchwork
):如果你想使用
ggarrange
,那么你可以将每一行图嵌套在另一个ggarrange
(尽管这显然比只使用patchwork
更冗长):
library(ggpubr)
library(ggplot2)
Cf <- Ff <- Of <- ggplot(mtcars, aes(disp, wt)) + geom_point()
sfplot = ggarrange(ggarrange(Cf, Ff, ncol = 2, labels = c("A", "B")),
ggarrange(NULL, Of, NULL, ncol = 3, labels = c("", "C", ""), widths = c(1,2,1)),
ncol = 1)
Output Output
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.