geom_density2d {ggplot2} | R Documentation |
Contours from a 2d density estimate
geom_density2d(mapping=NULL, data=NULL, stat="density2d", position="identity", ...)
mapping |
mapping between variables and aesthetics generated by aes |
data |
dataset used in this layer, if not specified uses plot dataset |
stat |
statistic used by this layer |
position |
position adjustment used by this layer |
... |
ignored |
Perform a 2D kernel density estimatation using kde2d and display the results with contours.
This page describes geom_density2d, see layer
and qplot
for how to create a complete plot from individual components.
A layer
The following aesthetics can be used with geom_density2d. Aesthetics are mapped to variables in the data with the aes
function: geom\_density2d(\code{aes}(x = var))
x
: x position (required)
y
: y position (required)
weight
: observation weight used in statistical transformation
colour
: border colour
size
: size
linetype
: line type
This can be useful for dealing with overplotting.
Hadley Wickham, http://had.co.nz/
geom_contour
: contour drawing geom
stat_sum
: another way of dealing with overplotting
## Not run: # See stat_density2d for examples ## End(Not run)