| geom_density2d {ggplot2} | R Documentation |
Perform a 2D kernel density estimatation using kde2d and display the results with contours.
geom_density2d(mapping = NULL, data = NULL, stat = "density2d", position = "identity", lineend = "butt", linejoin = "round", linemitre = 1, na.rm = FALSE, ...)
mapping |
The aesthetic mapping, usually constructed with
|
data |
A layer specific dataset - only needed if you want to override the plot defaults. |
stat |
The statistical transformation to use on the data for this layer. |
position |
The position adjustment to use for overlapping points on this layer |
lineend |
Line end style (round, butt, square) |
linejoin |
Line join style (round, mitre, bevel) |
linemitre |
Line mitre limit (number greater than 1) |
na.rm |
If |
... |
other arguments passed on to |
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
geom_contour for contour drawing geom,
stat_sum for another way of dealing with overplotting
# See stat_density2d for examples