title: Scale secondary y-axis in combination graph of barplot and line
body: <p>I made a graph in which a barplot and a line plot are combined. The problem is that the scale of my secondary y-axis isn't how it should be.</p>
  
  <p>This is the code I used:</p>
  
  <pre><code>barplot &lt;- barplot(covpatient[[1]]$cov, names.arg = covpatient[[1]]$exon, xlab = covpatient[[1]]$gene[1] , ylab = "read depth" , border = gray.colors(length(unique(covpatient[[1]]$exon)))[as.factor(covpatient[[1]]$exon)])
  par(new = TRUE)
  lines(x = barplot, y = covpatient[[1]]$amplicon, bty = "n")
  axis(side = 4, at = pretty(range(covpatient[[1]]$amplicon)))
  </code></pre>
  
  <p>And this is how my plot looks like: <img src="https://i.stack.imgur.com/4qc5w.gif" alt="plot"></p>
  
  <p>The values of the lines plot are OK, but you see that the y-axis is not fully expanded. I want it to look the same as the y-axis on the left</p>
  
  <p>Can someone help me with this?</p>