Specify widths and heights of plots with grid.arrange
<p>I have three plots and I try to combine them with grid.arrange. The last plot should have a smaller height than the first two plots and all the plots should have the same width.</p>

<p>A working example:</p>

<pre><code>p1 &lt;- qplot(mpg, wt, data=mtcars)
p2 &lt;- p1
p3 &lt;- p1 + theme(axis.text.y=element_blank(), axis.title.y=element_blank())

grid.arrange(arrangeGrob(p1,p2, ncol=1, nrow=2),
         arrangeGrob(p3, ncol=1, nrow=1), heights=c(4,1)) 
</code></pre>

<p><a href="https://i.stack.imgur.com/aTEvV.png" rel="noreferrer"><img src="https://i.stack.imgur.com/aTEvV.png" alt="enter image description here"></a></p>

<p>Here, the last plot has a larger width than the first two. In my real data, even if I keep the text and the title on the y-axis, I still have a different width for the third plot.</p>

<p>I tried to add "widths":</p>

<pre><code> grid.arrange(arrangeGrob(p1,p2, ncol=1, nrow=2),
         arrangeGrob(p3, ncol=1, nrow=1), heights=c(4,1), widths=c(2,1))
</code></pre>

<p>But it turns into a two column plot...</p>

<p><a href="https://i.stack.imgur.com/6a61f.png" rel="noreferrer"><img src="https://i.stack.imgur.com/6a61f.png" alt="enter image description here"></a></p>

<p>I also tried another code:</p>

<pre><code>p1 &lt;- ggplotGrob(p1)
p2 &lt;- ggplotGrob(p2)
p3 &lt;- ggplotGrob(p3)
# 
stripT &lt;- subset(p2$layout, grepl("spacer", p2$layout$name))
p3 &lt;- p3[-stripT$t, ]

grid.draw(rbind(p1, p2, p3, size = "first")) 
</code></pre>

<p>I have the same widths but now I don't know how to change the heights...</p>

<p><a href="https://i.stack.imgur.com/zRrLu.png" rel="noreferrer"><img src="https://i.stack.imgur.com/zRrLu.png" alt="enter image description here"></a></p>

<p>Well, can someone help me to combine both the height and width aspects for a final plot?</p>