stat_ydensity {ggplot2} | R Documentation |
1d kernel density estimate along y axis, for violin plot.
stat_ydensity(mapping = NULL, data = NULL, geom = "violin", position = "dodge", adjust = 1, kernel = "gaussian", trim = TRUE, scale = "area", na.rm = FALSE, ...)
trim |
If |
scale |
if "area" (default), all violins have the same area (before trimming the tails). If "count", areas are scaled proportionally to the number of observations. If "width", all violins have the same maximum width. |
na.rm |
If |
mapping |
The aesthetic mapping, usually constructed
with |
data |
A layer specific dataset - only needed if you want to override the plot defaults. |
geom |
The geometric object to use display the data |
position |
The position adjustment to use for overlappling points on this layer |
adjust |
see |
kernel |
kernel used for density estimation, see
|
... |
other arguments passed on to
|
A data frame with additional columns:
density |
density estimate |
scaled |
density estimate, scaled to maximum of 1 |
count |
density * number of points - probably useless for violin plots |
violinwidth |
density scaled for the violin plot, according to area, counts or to a constant maximum width |
n |
number of points |
width |
width of violin bounding box |
stat_ydensity
understands the following aesthetics (required aesthetics are in bold):
x
y
geom_violin
for examples, and
stat_density
for examples with data along
the x axis.
# See geom_violin for examples # Also see stat_density for similar examples with data along x axis