有人知道是否可以在用grid. arrangement()创建的图表的每一列中给予一个标题?我知道这是可能的,给予一个整体的标题和标题,每个图表,但我只需要一个列标题。非常感谢!
grid.arrange(c1b, c2a, c3d, c2b, c3a, c2d, c3b, c1a, c1d, ncol=3, nrow=3)
wtzytmuj1#
user20650:
library(tidyverse) library(gridExtra) #create a bunch of line graphs with the mtcars dataset graph1 <- ggplot(mtcars, aes(x = mpg, y = disp)) + geom_line() graph2 <- ggplot(mtcars, aes(x = mpg, y = hp)) + geom_line() graph3 <- ggplot(mtcars, aes(x = mpg, y = drat)) + geom_line() graph4 <- ggplot(mtcars, aes(x = mpg, y = wt)) + geom_line() grid.arrange(arrangeGrob(graph1, graph2, top = "Column A"), arrangeGrob(graph3, graph4, top = "Column B"), ncol = 2)
1条答案
按热度按时间wtzytmuj1#
user20650: