title: How can I control the canvas size in ggplot?
body: <p>Consider this simple ggplot:</p>
  
  <p><img src="https://i.stack.imgur.com/Psjm9.png" alt="enter image description here"></p>
  
  <p>I drew a black edge on it, so it's easier to envision how large it is.</p>
  
  <p>I don't understand why this plot is so large. There is nothing in my code telling ggplot that I want any area above or beneath the plot. </p>
  
  <p>This seems to get me every time. How can I control the canvas size in ggplot?</p>
  
  <pre><code>library(ggplot2)
  
  hex=c("#CC0000", "#90BD31", "#178CCB")    
  
  q &lt;- ggplot(data=NULL)
      q &lt;- q + geom_rect(data=NULL, aes(xmin=0, xmax=1, ymin=0.5, ymax=1.5), fill=hex[1])
      q &lt;- q + geom_rect(data=NULL, aes(xmin=1.5, xmax=2.5, ymin=0.5, ymax=1.5), fill=hex[2])
      q &lt;- q + geom_rect(data=NULL, aes(xmin=3, xmax=4, ymin=0.5, ymax=1.5), fill=hex[3])
      q &lt;- q + annotate("text", x=.5, y=0.1, label='Impaired', size=4)
      q &lt;- q + annotate("text", x=2, y=0.1, label='Normal', size=4)
      q &lt;- q + annotate("text", x=3.5, y=0.1, label='Optimal', size=4)
      q &lt;- q + coord_fixed()
      q &lt;- q + theme_classic()
      q &lt;- q + theme(axis.line=element_blank(),
                     axis.text.x=element_blank(),
                     axis.text.y=element_blank(),
                     axis.ticks=element_blank(),
                     axis.title.x=element_blank(),
                     axis.title.y=element_blank(),
                     panel.background=element_blank(),
                     panel.border=element_blank(),
                     panel.grid.major=element_blank(),
                     panel.grid.minor=element_blank(),
                     plot.background=element_blank())
      q
  </code></pre>