title: Broken confidence interval areas when using ylim in ggplot2
body: <p>I've been using <code>ggplot2</code> for long, but never experienced this issue. I am representing confidence intervals of some regressions. However, I decided to manually control the <code>ylim()</code>. I realized that those areas which exceed the y limits are broken. See this picture:</p>
  
  <p><a href="https://i.stack.imgur.com/1ljhn.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1ljhn.png" alt="enter image description here"></a></p>
  
  <p>The red regression on the right contains a very wide CLs. As you can see there is a gap in there as its highest point is outside ylim range.</p>
  
  <p>This is the code I used:</p>
  
  <pre><code>ggplot(dataset, aes(x=variable, y=value, fill=Species, colour=Species, linetype = Species)) + 
    geom_smooth(method="lm", formula= y~poly(x,3), level=0.95, alpha=0.2) + 
    xlab("A") +
    ylab("B") + 
    ylim(0, 30) + 
    theme(axis.text.x = element_text(angle = 0, hjust = 0.5, size = 10),
          panel.background = element_blank(),
          legend.position='bottom',
          panel.grid.major = element_line(colour="azure2"),
          axis.line = element_line(colour = "black", 
                        size = 0.15, linetype = "solid")) +
    scale_x_continuous(breaks=seq(1, 10, 1), limits=c(1, 10)) +
    scale_color_manual(values=c("coral4", "coral1", "darkolivegreen3", "darkgoldenrod4", "darkgoldenrod2", "deepskyblue3", "darkorchid3")) +
    scale_fill_manual(values=c("coral4", "coral1", "darkolivegreen3", "darkgoldenrod4", "darkgoldenrod2", "deepskyblue3", "darkorchid3")) +
    scale_linetype_manual(values=c(1,1,1,3,3,2,2))
  </code></pre>
  
  <p>I would like to keep these y limits. I used <code>coord_cartesian</code> with no success. Can anybody help me?</p>