title: Using ggplot Geom_Ribbon in R to fill under a continuous line
body: <p>I am trying to use geom_ribbon to fill an area under a geom_smooth line in ggplot and there are gaps under the curve where the color is not shaded. My data consists of six discrete values for proportion values on the y axis. Is there a way to use ymax in geom_ribbon differently to have the color meet the curved line better?</p>
  
  <p><a href="https://i.stack.imgur.com/PO9CD.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/PO9CD.png" alt="enter image description here"></a></p>
  
  <p>Here is the reproducible code for the data:</p>
  
  <pre><code>q1 &lt;- structure(list(Session = 1:6, Counts = c(244L, 358L, 322L, 210L, 
  156L, 100L), Density_1000 = c(NA, NA, NA, NA, NA, NA),             Proportion_Activity = c(0.175539568, 
  0.257553957, 0.231654676, 0.151079137, 0.112230216, 0.071942446
  ), Lifestage = structure(c(3L, 3L, 3L, 3L, 3L, 3L), .Label =    c("Adult", 
  "Nymph", "Larvae"), class = "factor")), .Names = c("Session", 
  "Counts", "Density_1000", "Proportion_Activity", "Lifestage"),    row.names = 13:18, class = "data.frame")
  </code></pre>
  
  <p>Here is the ggplot code:</p>
  
  <pre><code>ggplot(q1,aes(x=Session, y=Proportion_Activity, col =    Lifestage,fill=Lifestage)) 
  + geom_smooth(method = 'loess') 
  + geom_ribbon(data = q1,aes(x = Session, ymin=0,    ymax=Proportion_Activity, alpha=0.5))
  </code></pre>