I have two graphs showing supply and demand, and one graph in which I subtracted demand from supply to show the asymmetry that is emerging. I would like to shade the area between the x axis and the negative part of the asymmetry to show the extent of the deficit.
I am currently using the following code:
plot.asymmetry <- ggplot(data=df.overview.month, aes(x=Date.Time, y=Asymmetry)) + geom_area(data=subset(df.overview.month, Asymmetry < 0), aes(x=Date.Time, y=Asymmetry))
However, as expected, this does not obscure the area between geom_line and the x axis, but only between the negative values โโof the asymmetry data, which is completely different, as shown in the resulting graph:

Is there any way to overcome this problem?
/ Edit: some example data:
time.initial <- as.POSIXct("2010-12-31 23:00:00", tz="GMT") Date.Time<-vector() for(i in 1:24) { Date.Time[i] <- time.initial + i*3600 } Demand<-vector() for(i in 0:23) { Demand[i+1] <- 155 + 20*sin((pi/12)*i - (pi/2)) + 10*sin((pi/4380)*i + (pi/2)) } Supply<-vector() for(i in 0:23) { Supply[i+1] <- 165 + 5*sin((pi/4380)*i - (pi/2)) + rnorm(1, mean=0, sd=0.20*165) } df.overview.month <- data.frame(Date.Time, Demand, Supply, Asymmetry=Supply-Demand)
source share