combining geom_ribbon when x is a factor
<p>Leading on from this <a href="https://stackoverflow.com/questions/24419574/how-to-highlight-area-between-two-lines-ggplot">question</a>.</p>

<p>I cannot generate the shaded area when my <code>x</code> is a factor.
Here is some sample data</p>

<pre><code>time &lt;- as.factor(c('A','B','C','D'))
x &lt;- c(1.00,1.03,1.03,1.06)
x.upper &lt;- c(0.91,0.92,0.95,0.90)
x.lower &lt;- c(1.11,1.13,1.17,1.13)

df &lt;- data.frame(time, x, x.upper, x.lower)

ggplot(data = df,aes(time,x))+
  geom_ribbon(aes(x=time, ymax=x.upper, ymin=x.lower), fill="pink", alpha=.5) +
  geom_point()
</code></pre>

<p>when i substitute <code>factor</code> into the <code>aes()</code> I still cannot get the shaded region. Or if i try this:</p>

<pre><code>ggplot()+
  geom_ribbon(data = df, aes(x=time, ymax=x.upper, ymin=x.lower), fill="pink", alpha=.5) +
  geom_point(data = df, aes(time,x))
</code></pre>

<p>I still cannot get the shading. Any ideas how to overcome this...</p>