title: tableGrob not fully shown between two plots using grid.arrange in R
body: <p>My specific issue is evident when I output 3 plots to a html report using grid.arrange, sometimes the last plot (which is a tableGrob) is cropped.</p>
  
  <p>I am using 3 separate <code>grid.arrange()</code> statements to place a boxplot, a time series plot and a tableGrob in a html report using knitr.</p>
  
  <p>Code being used to output is:</p>
  
  <pre><code>  grid.arrange(p1,top=main)
    grid.arrange(p2TS)
  
    if(nrow(over5)&gt;0){
      tg=tableGrob(over5,theme=tt3,rows = NULL)
      tg$widths = unit(rep(1/4, ncol(tg)), "npc")
      grid.arrange(tg)
  
    }
  </code></pre>
  
  <p>This displays perfectly when the tg object has less than roughly 10 rows of data.</p>
  
  <p>However in testing larger datasets I found that the <code>grid.arrange(tg)</code> outputs in a fixed height "window" in the report which is not desirable.</p>
  
  <p>My question is how can I change the height of the <code>grid.arrange(tg)</code> ouput to match the height of the tg object contained inside (with some top and bottom margin)??</p>
  
  <p>I would appreciate understanding the mechanism by which these properties are changed so I can fine tune my output. I would have a 3x1 grid display all 3 outputs in one line of code if possible but all plots get condensed and unreadable so that is why I have 3 separate <code>grid.arrange()</code> statements. I Guess my real issue is I don't understand how there properties are manipulated here.</p>
  
  <p>Help is greatly appreciated.</p>