I've seen this asked, but never fully answered. Is it possible to plot stacked histograms in R? I have four data sets that I would like to show combined vertically in histogram format. Is this possible? Thank you for any feedback you can provide. P.S. I know I can show the four sets side by side, but I want to combine them, but still uniquely identify each. Thanks again. [[alternative HTML version deleted]]
On Fri, Jan 2, 2009 at 11:00 PM, Jason Rupert <jasonkrupert at yahoo.com> wrote:> I've seen this asked, but never fully answered. > > Is it possible to plot stacked histograms in R? > > I have four data sets that I would like to show combined vertically in histogram format. > > Is this possible?Yes, but it's generally not a terribly good way to display your data, as it is hard to read the values of all except the series on the bottom. install.packages("ggplot2") library(ggplot2) qplot(carat, data = diamonds, binwidth = 0.1) qplot(carat, data = diamonds, binwidth = 0.1, fill = cut) qplot(carat, data = diamonds, binwidth = 0.1, fill = color) qplot(carat, data = diamonds, binwidth = 0.1, fill = clarity) More examples at http://had.co.nz/ggplot2/geom_histogram.html Hadley -- http://had.co.nz/
Is this of any help? http://www.cse.unsw.edu.au/~mike/myrlibrary/geneplotter/html/histStack.html --- On Sat, 1/3/09, Jason Rupert <jasonkrupert at yahoo.com> wrote:> From: Jason Rupert <jasonkrupert at yahoo.com> > Subject: [R] R Stacked Histogram > To: r-help at r-project.org > Received: Saturday, January 3, 2009, 12:00 AM > I've seen this asked, but never fully answered.? > > Is it possible to plot stacked histograms in R? > > I have four data sets that I would like to show combined > vertically in histogram format.? > > Is this possible?? > > Thank you for any feedback you can provide. > > P.S. I know I can show the four sets side by side, but I > want to combine them, but still uniquely identify each.?? > Thanks again. > > > > > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at 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.__________________________________________________________________ Yahoo! Canada Toolbar: Search from anywhere on the web, and bookmark your favourite sites. Download it now at http://ca.toolbar.yahoo.com.