geom_density2d(mapping = NULL, data = NULL, stat = "density2d", position = "identity", lineend = "butt", linejoin = "round", linemitre = 1, na.rm = FALSE, ...)
aes or aes_string. Only
needs to be set at the layer level if you are overriding
the plot defaults.FALSE (the default), removes
missing values with a warning. If TRUE silently
removes missing values.layer. This can include aesthetics whose
values you want to set, not map. See layer
for more details.Perform a 2D kernel density estimatation using kde2d and display the results with contours.
This can be useful for dealing with overplotting.
geom_density2d understands the following aesthetics (required aesthetics are in bold):
x
y
alpha
colour
linetype
size
# See stat_density2d for examples
geom_contour for contour drawing geom,
stat_sum for another way of dealing with
overplotting