I am having a problem to increase the size and add a label for x axis when I use grid.arrange
.
I asked a question here how can I make my data side by side barplot with dots which the answer is sufficient and I accepted it.
At the end of the code, I should glue three parts together like this
library(gridExtra)
gg1 <- ggplot_gtable(ggplot_build(g1))
gg2 <- ggplot_gtable(ggplot_build(g2))
gg.mid <- ggplot_gtable(ggplot_build(g.mid))
grid.arrange(gg1,gg.mid,gg2,ncol=3,widths=c(4/9,1/9,4/9))
I want to add a Label for it but I could not find a way to do this. I also searched and I found only one related post Universal x axis label and legend at bottom using grid.arrange
and I tried to assigned my grid.arrange
to a variable and then
p <- grid.arrange(gg1,gg.mid,gg2,ncol=3,widths=c(4/9,1/9,4/9))
p <- arrangeGrob(p, textGrob("my label", gp=gpar(fontsize=12)))
print(p)
but the problem is not solved. Any idea how to add such a label for it?
Edit: perhaps the easiest way to control margins is to wrap the grob in a 3x3 gtable,