Consider the following ...
data.csv .....
Year,Category,Diff
1990,Elec,-1
1991,Elec,-2
1992,Elec,-3
1990,Land,-1
1991,Land,-2
1992,Land,-3
1990,Water,-1
1991,Water,-2
1992,Water,-3
1990,Sheep,0
1991,Sheep,4
1992,Sheep,9
library(ggplot2)
df=read.csv("data.csv",header=T)
ggplot(aes(x=Year,y=Diff),data=df)+geom_area(aes(fill=Category));
The (dummy) data represent changes in greenhouse emissions in a category. ie. in 1992 there were 3 less tonnes of GHG generated by electricity and so on, 3 less from
Land Clearing and so on. Extra sheep added 9 extra tonnes by 1992.
I want the increases (positive numbers) to be stacked and shown above zero and the decreases to be stacked and shown above zero. So you
can see every category and what's happened in that category. But the current geom combines them...
Any ideas? I could split the data into two panels ... but that seems a bit clumsy.