R/geom-density-line.R
geom_density_line.Rd
This function is a drop-in replacement for ggplot2's geom_density()
. The only difference is that
the geom draws a ridgeline (line with filled area underneath) rather than a polygon.
geom_density_line( mapping = NULL, data = NULL, stat = "density", position = "identity", ..., na.rm = FALSE, show.legend = NA, inherit.aes = TRUE )
mapping | Set of aesthetic mappings created by |
---|---|
data | The data to be displayed in this layer. There are three options: If A A |
stat | The statistical transformation to use on the data for this layer, as a string. |
position | Position adjustment, either as a string, or the result of a call to a position adjustment function. |
... | Other arguments passed on to |
na.rm | If |
show.legend | logical. Should this layer be included in the legends?
|
inherit.aes | If |
See geom_density()
.
#> Warning: Removed 45 rows containing non-finite values (stat_density).ggplot(diamonds, aes(depth, fill = cut, colour = cut)) + geom_density_line(alpha = 0.1) + xlim(55, 70)#> Warning: Removed 45 rows containing non-finite values (stat_density).