[R] overlapping/interleaved histogram help

From: Brian Hook <hook_l_at_bookofhook.com>
Date: Thu 03 Mar 2005 - 07:56:19 EST

NOTE: I have read the FAQ, Verzani's book, Rtips, and googled.

For various reasons I don't want to use a density plot when comparing two distributions, I would prefer to have interleaved histograms over the same ranges.

In addition to this, I would also like to normalize the two histograms so that both of their max Y values are the same (so I can compare relative distributions within one distribution to the relative distributions within another, i.e. peaks). The data is clustered in a narrow range with quite a few outliers, and for this reason the regular histogram function with default parameters tends to give a poor graph (very wide swaths to encompass the outliers), whereas I'd prefer a fixed visual size to cover the outliers.

My current instinct is that I will have to do the following:

  1. Take existing data and bin it
  2. Iterate over data and perform optional normalization
  3. Interleave the two data sets
  4. Render with bar plots

If those sounds like the appropriate steps then I'll research it and go with that, but I'm hoping there's a much simpler solution.



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Thu Mar 03 08:03:36 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:30:39 EST