title: Arrange odd number of plots using rasterVis and gridExtra
body: <p>I am trying to plot a panel with seven rasters using the <code>levelplot</code> function of the <code>rasterVis</code> package, combined with <code>gridExtra</code>'s <code>grid.arrange</code>. </p>
  
  <p>I almost get what I need by using the following code:</p>
  
  <pre><code># load required packages
  library(rasterVis)
  library(gridExtra)
  
  # load sample raster
  f &lt;- system.file("external/test.grd", package="raster")
  r &lt;- raster(f)
  
  # create plots
  p1 &lt;- levelplot(r, xlab=NULL, ylab=NULL, margin=FALSE)
  p2 &lt;- levelplot(r*2, xlab=NULL, ylab=NULL, margin=FALSE,colorkey=FALSE)
  
  # put plots in list
  p.list &lt;- list(p1,p2,p2,p2,p2,p2,p2)
  
  # create layout
  lay &lt;- rbind(c(1,1,1),
               c(2,3,4),
               c(5,6,7))
  
  # arrange plots
  grid.arrange(grobs=p.list, layout_matrix=lay)
  </code></pre>
  
  <p>which yields this figure:</p>
  
  <p><a href="https://i.stack.imgur.com/HNRja.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/HNRja.png" alt="enter image description here"></a></p>
  
  <p>However, there are some things I still need to improve:</p>
  
  <ol>
  <li>How to decrease the blank space between the plots in the bottom rows?</li>
  <li>How to add a single, combined legend for the six bottom rasters, preferentially put to the bottom of the figure?</li>
  </ol>
  
  <p>Is this possible to achieve using <code>rasterVis</code> and <code>gridExtra</code>? Is there any other approach that can be used?</p>