Two ggplots in one figure, plotted close together
<p>I'm looking to plot a filled contour with geom_tile and the corresponding raw trace directly below it with no space between the two. When using gridExtra or cowplot, I can get them close but not to where the top of raw trace is on the x axis of the filled contour. Here are the details:</p>

<p><strong>Data</strong></p>

<pre><code>library(reshape2)
library(ggplot2)
volcano=volcano
volcano3d=melt(volcano)
names(volcano3d) &lt;- c("x", "y", "z")
</code></pre>

<p><strong>Plots</strong></p>

<pre><code>fill=ggplot(volcano3d,aes(x,y,z))+geom_tile(aes(fill=z))
raw=ggplot(volcano3d,aes(x,y))+geom_line()+theme(aspect.ratio=1/20)
</code></pre>

<p><strong>My attempts</strong></p>

<pre><code>library(gridExtra)
grid.arrange(fill,raw,heights=c(5,1)
</code></pre>

<p>While they are pretty close, I'd like to do a few things:</p>

<ol>
<li>Move the bottom trace up so the top of the bottom trace is touching the xaxis of the contour plot. </li>
<li>Align the two axis so 0,25,50,75 are all aligned. In cowplot you can use the align the argument so that's fine, but I can't figure out how to move them closer to each other. </li>
</ol>

<p><strong>Ideal Plot</strong></p>

<p>This is from a different data set, but its a good example of the layout. 
<a href="https://i.stack.imgur.com/NnH8b.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/NnH8b.png" alt="enter image description here"></a></p>

<p>thoughts?</p>