title: geom_smooth moves based on scale_y_continuous limits
body: <p>Here is a plot of stopping distance vs. speed, for the <code>cars</code> data, smoothed. </p>
  
  <pre><code>ggplot(cars, aes(x=cars$speed,y=cars$dist)) + 
  +   scale_x_continuous(expand = c(0, 0)) +
  +   scale_y_continuous(expand = c(0, 0), limits=c(-20,125)) + geom_smooth()
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/UwRsA.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/UwRsA.png" alt="enter image description here"></a></p>
  
  <p>Note that the grey confidence interval goes up to about 112.5.</p>
  
  <p>Now suppose I want to crop some of the unused area at the top of the plot, by changing the y-axis limits.</p>
  
  <pre><code>ggplot(cars, aes(x=cars$speed,y=cars$dist)) + 
  +   scale_x_continuous(expand = c(0, 0)) +
  +   scale_y_continuous(expand = c(0, 0), limits=c(-20,116)) + geom_smooth()
  Warning message:
  Removed 1 rows containing non-finite values (stat_smooth). 
  </code></pre>
  
  <p>Note the warning message; I'll come back to that.</p>
  
  <p><a href="https://i.stack.imgur.com/5oJ7A.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5oJ7A.png" alt="enter image description here"></a></p>
  
  <p>See how the grey confidence interval now only goes up to about 104?
  I suspect that is because the <code>geom_smooth</code> function discarded one of the original data points because it is outside of the range, and that changed the smoothing calculation. (Indeed, one of the stopping distances is 120.) I assume that's what the warning message meant.</p>
  
  <p>How can I work around this? The wasted space in the original plot isn't much of a problem, but with my own data, I would have a huge amount of wasted space. Do I need to calculate the smoothing formula separately, and then plot that using <code>geom_ribbon</code> and <code>geom_line</code>?</p>
  
  <p>There is an option for <code>geom_smooth</code>, <code>fullrange=TRUE</code>, that you can use if your x-axis limits don't include all of the data. But that doesn't work here, and there isn't a <code>fulldomain=TRUE</code> option.</p>
  
  <hr>
  
  <p>EDIT: The <em>problem</em> described here is different from the one described in <a href="https://stackoverflow.com/questions/35344065">ggplot2: geom_smooth confidence band does not extend to edge of graph, even with fullrange=TRUE</a> (even though the solution is essentially the same). That problem is about the grey confidence interval being <em>cut off</em>. This problem is about the smoothing line and the interval being <em>changed</em> by the axis limits. I don't know that someone searching for a solution to this problem would be likely to recognise that the other problem has the same solution; it was only by chance that I did.</p>