[R] Stacked area chart and legends

mbr mattblakley at gmail.com
Mon Oct 6 17:54:37 CEST 2008


I have found lots of good advice on this forum about stacked area charts but
I’ve run into problems with the 2 recommended options: stackploy in plotrix
or qplot in ggplot2. I have a many page report that will be in a 2x2 page
format “par(mfrow=c(2,2))”” and need one of the page components to be a
stacked chart. 

I’d prefer to use stackpoly, if possible, but I’m stuck on how to do the
legend in hopefully a relatively simple way. I just need a simple legend to
be outside the plot area (b/c the plot area is full as I’m doing it as 100%
stacked area chart format) on the right side with the little box with the
color and the series name next to it – same/similar to Excel format.

The qplot approach would work as well and seems like the legend is built
into the default, but the graph always ends up on its own page and can’t
figure out how to force it into one of boxes of my 2x2 page layout. I like
the looks of the stackpoly more as consistent with other graphs I have on
report but qplot stacked chart would be fine if I could get it into the
layout.

Please let me know if you have any suggestions or could point me to
somewhere this has been discussed before. Many thanks for any help.


-- 
View this message in context: http://www.nabble.com/Stacked-area-chart-and-legends-tp19840703p19840703.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list