> p<-ggplot(reading.melt,aes(x=Date,y=value)) > p+geom_path(aes(colour=Type),size=2)+facet_grid(variable~.) > > but can't figure out > (1) How to add a transparent shade between the Paid & Total lines. I've > tried the ribbon function, but cant seem to get it to shade between the > lines
To do this you'll need the data in a different format df <- cast(reading.melt, ... ~ Type) Then add on a ribbon as follows p <- ggplot(reading.melt,aes(x=Date)) + facet_grid(variable ~ .) + geom_ribbon(aes(min = Paid, max=Total), data=df, fill=alpha("black", 0.1), colour=NA) + geom_path(aes(colour=Type ,y=value)) > (2) Add a left justified title to the chart p + opts(title = "My title") adds a title, and to left justify it, you need to use grid to modify it: grid.edit("title", x=unit(0, "npc"), hjust=0) Hadley -- http://had.co.nz/ ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.