Consider the following code:
library(ggplot2) foo <- data.frame(x=1:10,A=1:10,B=10:1) ggplot(melt(foo,id.vars=\"x\"),aes(x,value,color=variable))+geom_lin
Try this,
last_plot() + aes(group=rev(variable))