title: R plot, control axis height or limit
body: <p>I'm drawing two staked plot using par(mfrow = c(2,1)). On the lower plot I removed the default axis and added my own (this is a dummy example of a much more complex plot where I need to do this).</p>
  
  <p>The problem is that the axis I added goes up to the upper limit of the lower plot box, overlapping the numbers of the upper plot axis.</p>
  
  <p>I therefore need to limit the height of the lower plot axis in order to not overlap.</p>
  
  <p><img src="https://i.stack.imgur.com/kHIJI.png" alt="enter image description here"></p>
  
  <p>Here some dummy code, I hope it would reproduce the effect:</p>
  
  <pre><code>serie1 &lt;- c(45, 257, 25, 55, 89, 297, 471, 1256, 312, 969, 788, 425, NaN, 77, 43, 38, 20, 6, 16, 13, 11, 6, 7, 2, 0, 31, 4, 3, 2, 2, 3, 4, 10, 16, 200, NaN)
  serie2 &lt;- c(1106, 1654, 578, 1354, 536, 2384, 586, 1356, 1457, 1508, 4567, 4501, 4037, 7735, 6118, 2775, 1196, 916, 551, 991, 109, 174, 278, 100, 98, 124, 122, 138, 256, 226, 445, 638, 511, 465, 1733, 1278)
  
  opar &lt;- par(mfrow = c(2,1))
  
  par(mar = c(0,4,4,2))
  plot.ts(serie1, col = 'red', lwd = 3, xaxt= 'n', xlab='')
  
  par(mar = c(5,4,0,2))
  plot.ts(serie2, col = 'blue', lwd = 3, xaxt = 'n', yaxt = 'n', ylab = '', xlab = '')
  
  axis(2)
  mtext(side = 2, line = 3, 'serie2')
  
  par(opar)
  </code></pre>