title: Increasing vertical space between segments in base R
body: <p>I'm trying to increase the space between each segment for each successive interval to avoid overplotting. Not sure how to approach this so that it will increment vertically in the loop. </p>
  
  <p>Here is my code and some reproducible data: </p>
  
  <pre><code>
  set.seed(200)
  x &lt;- rnorm(100, 10) 
  truemean &lt;- mean(x)
  
  mat &lt;- replicate(100, t.test(sample(x, rep = T))$conf.int) 
  mat &lt;- t(mat)
  
  myfunc &lt;- function(mat, truemean) {
  
    plot(x = c(min(mat[ , 1]), max(mat[ , 2])), 
         y = c(1, 100), 
         type = "n", 
         xlab = "0:100",
         ylab = "0:100")
  
    abline(v = truemean)
  
    for (i in 1:nrow(mat)) {
  
      if (mat[i, 1] &lt;= truemean &amp; mat[i, 2] &gt;= truemean) {
  
        segments(x0 = mat[i, 1], y0 = i, 
                 x1 = mat[i, 2], y1 = i, 
                 col = "blue",
                 lwd = 2)
  
      } else {
  
        segments(x0 = mat[i, 1], y0 = i, 
                 x1 = mat[i, 2], y1 = i, 
                 col = "red", 
                 lwd = 2) 
  
      }
  
    }
  
  }
  
  myfunc(mat, truemean) 
  
  </code></pre>