Skip to content
Prev 134056 / 398498 Next

Overlay plots from different data sets using the Lattice package

On Jan 15, 2008 12:27 PM, Dieter Menne <dieter.menne at menne-biomed.de> wrote:
Yes, that does require a little explanation.  The .. tells ggplot the
variable (density) is not in the original dataset, but is instead
produce by the statistical transformation (stat_bin for the histogram
and stat_density for the density plot).  By default the histogram uses
..count.. (the raw count) while density uses ..density.., so y =
..density.. tells them both to use the same scale (you could also use
y = ..count.. but count on a density is plot is a little less common)

Hadley