ggplot2: fill color behaviour of geom_ribbon
<p>I am trying to colour ribbons in ggplot2. When using geom_ribbon, I am able to specify ymin and ymax and a fill color. What it now does is coloring everything that is between ymin and ymax with no regard to upper Limit or lower Limit. </p>

<p>Example (modified from Internet):</p>

<pre><code>library("ggplot2")
# Generate data (level2 == level1)
huron &lt;- data.frame(year = 1875:1972, level = as.vector(LakeHuron), level2 = as.vector(LakeHuron))

# Change Level2
huron[1:50,2] &lt;- huron[1:50,2]+100
huron[50:90,2] &lt;- huron[50:90,2]-100

h &lt;- ggplot(huron, aes(year))

h +
  geom_ribbon(aes(ymin = level, ymax = level2), fill = "grey80") +
  geom_line(aes(y = level)) + geom_line(aes(y=level2))
</code></pre>

<p>will result in this Chart:
<a href="https://i.stack.imgur.com/PSgu9.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/PSgu9.jpg" alt="enter image description here"></a></p>

<p>I'd like to fill the area, where (ymin > ymax), with a different colour  than where (ymin &lt; ymax). In my real data I have export and import values. There, I'd like to color the area where export is higher than import green, where import is bigger than export I want the ribbon to be red.</p>

<p>Alternative: I'd like geom_ribbon to only fill the area, where ymax > ymin.</p>

<p>Does anybody know how this is done?</p>

<p>Thanks for your help.</p>