title: geom_smooth Match shaded area to line colour
body: <p>This is my data:</p>
  
  <pre><code>    data &lt;- read.table(text = "
        Abundance Time Water_mass
  305         323  434        SAW
                     954         416  476        SAW
                     1545        519  154        SAW
                     2049        693  188        SAW
                     2459       9360  353        SAW
                     2988        345  434        SAW
                     3472        524  154        SAW
                     3958        486  188        SAW
                     4484       8739  353        SAW
                     5051        581  476        SAW
                     5539        505  188        SAW
                     6025       6090  353        SAW
                     6596        343  434        SAW
                     7125        533  476        SAW
                     7611        655  154        SAW
                     8099        569  188        SAW
                     8586       7373  353        SAW
                     9236        194  434        SAW
                     9680        979  476        SAW
                     10046       794  154        SAW
                     10654       418  188      FRONT
                     11261      3588  353        SAW
                     11547       309  434        SAW
                     12034       693  154        SAW
                     12603       591  188      FRONT
                     13169       370  434        SAW
                     13697       534  476      FRONT
                     14427       659  154        SAW
                     14944       733  188      FRONT
                     15467      1373  353      FRONT
                     15987       373  434        SAW
                     16377       495  154        SAW
                     17012      1331  353      FRONT
                     17392       585  434      FRONT
                     17837      1188  476        STW
                     18444       519  154        SAW
                     18932       808  188      FRONT
                     19418      5073  353      FRONT
                     20026       402  434      FRONT
                     20392      1021  476        STW
                     21121       753  154        SAW
                     21573       378  188      FRONT
                     21977      6270  353      FRONT
                     22343       769  434        STW
                     23072      1311  476        STW
                     23559       570  154        STW
                     24207       587  188        STW
                     24694       370  434        STW
                     25253       625  188        STW
                     25767     44258  353        STW
                     26116      1655  434         NW
                     26604      1792  476        STW
                     27089       448  154        STW
                     27697      1874  188        STW
                     28292     28669  353        STW
                     28670       960  434         NW
                     29389       485  154        STW
                     29877       476  476      FRONT
                     30415     28771  353        STW
                     30959      1538  476        STW
                     31454      1884  434         NW
                     31906      2158  476         NW
                     32487      1417  154         NW
                     32971      2560  188         NW
                     33418     38646  353         NW
                     34028      2887  434         NW
                     34513      1509  476         NW
                     35039      1441  154         NW
                     35241      2553  188         NW
                     36091       692  353         NW
  ", header = TRUE)
  </code></pre>
  
  <p>I have made this graph, but would like to colour the envelopes to match the colour of the lines:</p>
  
  <p><a href="https://i.stack.imgur.com/PGkPx.png" rel="nofollow noreferrer">Abundance vs Time for each Water mass</a></p>
  
  <p>The code I tried is:</p>
  
  <pre><code>data$Water_mass &lt;- factor(data$Water_mass, levels = c("NW", "STW", "FRONT", "SAW"))
  ggplot(data,aes(x=Time,y=Abundance,col=Water_mass)) + geom_point(size=3) + geom_smooth(method="auto", se=TRUE, fullrange=FALSE, level=0.95, fill = data$Water_mass)
  </code></pre>
  
  <p>However, I got this error:</p>
  
  <pre><code>Error: Aesthetics must be either length 1 or the same as the data (320): fill
  </code></pre>
  
  <p>I was trying to follow the instructions in <a href="https://stackoverflow.com/questions/9613578/changing-standard-error-color-for-geom-smooth">Changing standard error color for geom_smooth</a>, but this didn't work. The data that I am trying to use to colour the envelopes is the same as what I had used earlier, so I don't understand why it says it is a different length (or where the 320 comes from).</p>