title: Problem with axis limits when plotting curve over histogram
body: <p>newbie here. I have a script to create graphs that has a bit that goes something like this:</p>
  
  <pre><code>png(Test.png)
  ht=hist(step[i],20)
  curve(insert_function_here,add=TRUE)
  </code></pre>
  
  <p>I essentially want to plot a curve of a distribution over an histogram. My problem is that the axes limits are apparently set by the histogram instead of the curve, so that the curve sometimes gets out of the Y axis limits. I have played with par("usr"), to no avail. Is there any way to set the axis limits based on the maximum values of either the histogram or the curve (or, in the alternative, of the curve only)?? In case this changes anything, this needs to be done within a for loop where multiple such graphs are plotted and within a series of subplots (par("mfrow")). </p>