title: Control the width of the graphs using Knit2PDF package
body: <p>I'm trying to build graphs in a PDF format from the output from my R script. I'm using the knit2PDF package to do this.</p>
  
  <p>When I have more than one data point to plot it plots fine. Eg:<a href="https://i.stack.imgur.com/02NDr.png" rel="nofollow"><img src="https://i.stack.imgur.com/02NDr.png" alt="When there is more than one data point"></a></p>
  
  <p>However, when there is only data point the graph looks something like this<a href="https://i.stack.imgur.com/MRaJN.png" rel="nofollow"><img src="https://i.stack.imgur.com/MRaJN.png" alt="One data point"></a></p>
  
  <p>Here's the code im using :</p>
  
  <pre><code> plot.new()
        par(mar=c(2,0,0,0))
        par(xpd=T, mar=par()$mar+c(0,0,0,4))
        bplot= barplot(p[c("Control","Exposed"),], col=c("#0078E8","#FF9900"),
               beside=T,names.arg=paste(paste(colnames(p),sep = " "),
                            paste("Control:", p["Control_count",], sep=" "),
                            paste("Exposed:", p["Exposed_count",], sep= " ")
                            ,sep="\n"),
               cex.names=0.4, width = 0.5, axes=F, border=F,space=c(0,1),ylim=c(0,max(p[c("Control","Exposed"),]+10)))
  </code></pre>
  
  <p>Is there a way I can control the look of the graph automatically when there is one data point ?</p>