changing title in multiplot ggplot2 using grid.arrange
Asked Answered
W

2

64

I have managed to make a 2x2 plot using grid.arrange:

library(gridExtra)
grid.arrange(p1,p3,p2,p4, ncol=2, nrow=2, top = "Daily QC: Blue")

The main title of this multiplot is very small. Is there a way to change the title text size and font.

Wordplay answered 6/2, 2013 at 9:55 Comment(0)
N
88
main=textGrob("Daily QC: Blue",gp=gpar(fontsize=20,font=3))

Edit with v>=2.0.0 of gridExtra, main has become top (for consistency with bottom, left and right).

Ninon answered 6/2, 2013 at 10:8 Comment(0)
L
57

Due to changes in both packages grid and gridExtra, the current answer is outdated. Library package grid is also required to use textGrob and gpar.

The new code should include both packages:

library(grid)
library(gridExtra)
grid.arrange(p1,p3,p2,p4, ncol=2, nrow=2,
     top = textGrob("Daily QC: Blue",gp=gpar(fontsize=20,font=3)))
Largehearted answered 11/4, 2018 at 6:18 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.