something
is a new variable that has been produced by a stat, which is a ggplot2
mechanism that will transform your original dataset in some way (e.g., binning the data, smoothing the data). The ..
distinguishes it from variables in your input, so that there's no confusion.
In your example, ..density..
is the density, which you can map the height of the histogram bars to, rather than the raw count in each bin (..count..
, the default). ..density..
is computed by stat_bin
.
As far as I know, there's no one place in the documentation where this is explained (though if you have access to the ggplot2
book, look at section 4.7), but the new variables created by each stat are listed in the stat documentation pages, under the Value section. For example, looking at the documentation for stat_bin, you can see that the variables count
, density
, ncount
, and ndensity
are created, which can be accessed by ..count..
, ..density..
, ..ncount..
, and ..ndensity..
.