title: R ggplot: Remove all space around plot
body: <p>How do I remove all space around the plot area?</p>
  
  <p>Sample data </p>
  
  <pre><code>dfr &lt;- data.frame(x=factor(1:5),y=c(3,5,4,2,4))
  
  ggplot(dfr,aes(x,y))+
    geom_bar(stat="identity")
  </code></pre>
  
  <p>I tried as below, but there is still space on left and bottom. Bg border colour added to visualise edge.</p>
  
  <pre><code>ggplot(dfr,aes(x,y))+
    geom_bar(stat="identity")+
    labs(x="",y="")+
    theme(axis.ticks=element_blank(),
          axis.text=element_blank(),
          plot.background=element_rect(colour="steelblue"),
          plot.margin=grid::unit(c(0,0,0,0),"cm"))
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/9v8Sn.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9v8Sn.png" alt="enter image description here"></a></p>