title: Geom_area with different colors for fill
body: <p>I have a <code>DF</code> with 4 columns: <code>date</code>, <code>original</code>, <code>predicted</code> and <code>change</code>. I would like to make an area graph and the values that are negative are red and the positive ones are green according to the <code>change</code> column.</p>
  <p>My code:</p>
  <pre><code>data %&gt;% 
    filter(variaveis == c(&quot;diferenca.em.pontos&quot;)) %&gt;%
    mutate(change = ifelse(value &gt; 0, &quot;positive&quot;, &quot;negative&quot;)) %&gt;%
    ggplot(aes(x = Período, y = value, fill = change)) +
    geom_area() +
    geom_hline(yintercept = 0)
  </code></pre>
  <p>But it's returning like this, with this green line above the red values, and this was not supposed to happen. What am I doing wrong?</p>
  <p><a href="https://i.stack.imgur.com/4XvMD.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4XvMD.png" alt="enter image description here" /></a></p>
  <p>If I use <code>geom_col</code> instead of <code>geom_area</code>, the graph is right:</p>
  <p><a href="https://i.stack.imgur.com/uww2Z.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/uww2Z.png" alt="enter image description here" /></a></p>
  <p>My <code>dput</code>:</p>
  <pre><code>structure(list(Período = structure(c(13453, 13483, 13514, 13545, 
  13573, 13604, 13634, 13665, 13695, 13726, 13757, 13787, 13818, 
  13848, 13879, 13910, 13939, 13970, 14000, 14031, 14061, 14092, 
  14123, 14153, 15918, 15949, 15979, 16010, 16040, 16071), class = &quot;Date&quot;), 
      variaveis = structure(c(5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 
      5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 
      5L, 5L, 5L, 5L, 5L, 5L), .Label = c(&quot;Brasil&quot;, &quot;Brasil.predicted&quot;, 
      &quot;Brasil.nivel&quot;, &quot;Brasil.predicted.nivel&quot;, &quot;diferenca.em.pontos&quot;
      ), class = &quot;factor&quot;), value = c(28.5307986472031, 22.8246389177625, 
      16.3033135126875, 6.52132540507499, 4.07582837817188, -12.2274851345156, 
      -10.5971537832469, -8.96682243197813, -6.521325405075, -4.89099405380624, 
      -11.4123194588812, -20.3791418908594, -8.96682243197812, 
      -10.5971537832469, -9.7819881076125, -6.521325405075, 0, 
      -8.15165675634375, -27.7156329715687, -43.2037808086219, 
      -34.2369583766437, -26.9004672959344, -17.9336448639562, 
      -38.3127867548156, -18.7488105395906, -25.2701359446656, 
      -21.1943075664937, -14.6729821614187, -8.15165675634375, 
      0.815165675634374), change = c(&quot;positive&quot;, &quot;positive&quot;, &quot;positive&quot;, 
      &quot;positive&quot;, &quot;positive&quot;, &quot;negative&quot;, &quot;negative&quot;, &quot;negative&quot;, 
      &quot;negative&quot;, &quot;negative&quot;, &quot;negative&quot;, &quot;negative&quot;, &quot;negative&quot;, 
      &quot;negative&quot;, &quot;negative&quot;, &quot;negative&quot;, &quot;negative&quot;, &quot;negative&quot;, 
      &quot;negative&quot;, &quot;negative&quot;, &quot;negative&quot;, &quot;negative&quot;, &quot;negative&quot;, 
      &quot;negative&quot;, &quot;negative&quot;, &quot;negative&quot;, &quot;negative&quot;, &quot;negative&quot;, 
      &quot;negative&quot;, &quot;positive&quot;)), row.names = c(1L, 2L, 3L, 4L, 5L, 
  6L, 7L, 8L, 9L, 10L, 11L, 12L, 13L, 14L, 15L, 16L, 17L, 18L, 
  19L, 20L, 21L, 22L, 23L, 24L, 82L, 83L, 84L, 85L, 86L, 87L), class = &quot;data.frame&quot;)
  </code></pre>