title: How can I manage margin in basic plot/image in r?
body: <p>I made a blank reactive plot with a basic plot, and printed huge characters in shinydashboard. </p>
  
  <p>The problem is that when I made the letters in the plot visible, the margin at the top of the plot is too large.</p>
  
  <p>But when I fixed the margin argument, png size, and list argument in <code>renderImage()</code>, the size of margin was fine, but the text is too small and I cannot read the labels anymore. I tried to set the <code>cex</code> argument, which worked but not very well. Also, <code>oma=c()</code> argument wasn't woriking in my code.</p>
  
  <p>So, what can I do? This is my code about plot.</p>
  
  <pre><code>outfile &lt;- tempfile(fileext='.png')
  
  png(outfile, height=500*25, width=1000, bg='transparent')
  par(mar=c(0, 4, 1, 4))
  plot(0, 0, xlim=c(1,50), ylim=c(1,500*4), ann=F, xaxt = 'n', yaxt='n', type="n", xlab="")
  for(j in 1:500){# i=x, j=y
     for(i in 1:50){
        text(i, 500*4+4-j*4, labels=data0[i+50*(j-1)], cex=2, family='raleway')
     }
  }
  dev.off()
  
  
  list(src = outfile, contentType = 'image/png', width=800, height=sizej*15)
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/3kXbQ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/3kXbQ.png" alt="Huge margin"></a></p>
  
  <p><a href="https://i.stack.imgur.com/WY4NA.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/WY4NA.png" alt="Cannot distinguish anything"></a></p>