title: Resize side-by-side multiple barplots in R
body: <p>I used this <a href="https://stackoverflow.com/questions/36845682/using-sapply-in-r-for-ploting-side-by-side-graph">answer</a> to plot 15 barplots (side-by-side) in one PDF page. The issue is the figures quality becomes very small. </p>
  
  <pre><code>dat &lt;- read.table("data.txt",header=TRUE)
  
  pdf('plot.pdf')
  m &lt;- rbind(c(1,2,3), c(4,5,6),c(7,8,9),c(10,11,12),c(13,14,15))
  layout(m)
  barcols &lt;- c("red","blue","green","orange","black","yellow")
  
  sp &lt;- split(dat, dat$Project)
  
  sapply(seq_along(sp),
         function(x) {
           dd &lt;- sp[[x]]
           m &lt;- t(`rownames&lt;-`(as.matrix(dd[, -(1:2)]), dd[, 1]))
           bp &lt;- barplot(m,ylim=c(0, 0.4),beside=TRUE,col=barcols)
           title(main=names(sp[x]))
          # abline(h=0)
         }
  )
  plot(NA,xlim=c(0,1),ylim=c(0,1),ann=FALSE,axes=FALSE)
  legend(0,0.6,c("C10","C10","C03","C11","C16","C08"),fill=barcols,cex=1.5)
  dev.off()
  </code></pre>
  
  <p>The result of the above code as follow:
  <a href="https://i.stack.imgur.com/sIrwb.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/sIrwb.jpg" alt="enter image description here"></a></p>
  
  <p>Would it be possible to resize the figures, in order to make x-axis data readable? </p>
  
  <p>The data format as follow: </p>
  
  <pre><code>Topic  Project  C10     C14     C03     C11     C16     C08
  T1     P1       0.24    0.00    0.00    0.04    0.04    0.00
  T2     P1       0.00    0.30    0.00    0.00    0.00    0.00
  T3     P1       0.04    0.04    0.00    0.24    0.00    0.00
  T4     P1       0.00    0.00    0.00    0.04    0.33    0.04
  T5     P1       0.00    0.09    0.21    0.00    0.00    0.00
  T6     P1       0.00    0.09    0.00    0.00    0.00    0.34
  T1     P2       0.20    0.00    0.00    0.04    0.00    0.04
  T2     P2       0.00    0.22    0.04    0.00    0.00    0.00
  T3     P2       0.04    0.00    0.00    0.24    0.00    0.00
  T4     P2       0.00    0.00    0.04    0.00    0.33    0.00
  T5     P2       0.04    0.00    0.21    0.00    0.00    0.00
  T6     P2       0.00    0.04    0.00    0.00    0.00    0.34
  T1     P3       0.20    0.00    0.00    0.04    0.00    0.04
  T2     P3       0.00    0.22    0.04    0.00    0.00    0.00
  T3     P3       0.04    0.00    0.00    0.24    0.00    0.00
  T4     P3       0.00    0.00    0.04    0.00    0.33    0.00
  T5     P3       0.04    0.00    0.21    0.00    0.00    0.00
  T6     P3       0.00    0.04    0.00    0.00    0.00    0.34
  ...
  ...
  </code></pre>