title: Crop out ggplot2 whitespace around plot
body: <p>Is there a way to remove the white space surrounding a ggplot2 plot when the shape has been changed using <code>coord_fixed()</code>? I would like the white space above and below to be cropped away so that only the plotting area and axis labels remain. I am rendering the plot output in an R markdown file without saving.</p>
  <pre><code> p &lt;- ggplot(mtcars, aes(mpg, wt)) + geom_point()
   p + coord_fixed(ratio = 1)
  </code></pre>
  <p>The code below produces the following plot:</p>
  <p><a href="https://i.stack.imgur.com/X6oYL.png" rel="noreferrer"><img src="https://i.stack.imgur.com/X6oYL.png" alt="plot with white space" /></a></p>