I would just point out this related question. It's a real leap to go from this solution to solving your particular problem, but I'm posting this in case it might help.
With this sample data:
b<-cumsum(rnorm(100))
x<-sample(c(1,2), size=100, replace=TRUE)
t<-1:(length(b))
Here x would represent your values, b is the color (rising/falling), and t is the x-axis. Reformat it with melt:
library(ggplot2)
tmp <- melt(data.frame(cbind(t,b,x)),meas=c("x"))
head(tmp)
And plot it:
ggplot(tmp, aes(x=t,groups=variable)) +
facet_wrap(~variable) +
geom_path(aes(y=b,colour=factor(value))) +
labs(x=NULL)
Shane
2009-10-09 23:38:23