Hi all, I have been hunting around for hours trying to figure out how to generate a stacked line chart using ggplot2. This type of chart can be generated in excel 2007 by selecting: Chart type > Line > Stacked line. I can generate a stacked area chart using the following code:
p <- ggplot2(~, aes(x = ~, y = ~, colour = Type)) + geom_area(aes(position = 'stack', fill = Type)) However, when I try and replicate this using the following code for geom_line: p <- ggplot(~, aes(x = ~, y = ~, colour = Type)) + geom_line(aes(position = 'stack')) the resulting plot is not stacked - i.e. each 'Type' is plotted at its actual value rather than cumulatively to form a stacked chart... I have poured through Hadley's ggplot2 book (ggplot2: elegant graphics for data analysis), the R help list and also done general google searching but cannot find a way to generate this type of plot. R version: 2.9.2 ggplot2 version: 0.8.5 OS: windows 7 (64-bit). Any suggestions or assistance would be greatly appreciated. Regards, Liam ______________________________________________ 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.