ggplot(data, mapping = aes(x, y)) +
geom_density(mapping = aes(alpha, colour, fill, group, linetype, size, weight))
- Required Components:
- geom_density()
- x & y variables
- Additional Notes:
- count = number of points / number of points scaled to 1
- density / ndensity = density of points in bin, scaled to 1
- scaled = density estimate, scaled to 1
- Optional Components:
- alpha- transparency
- colour - colour of density line
- fill - filled colour below the line
- group - grouped variables
- linetype - Type of line
- size - Line size
- weight - width of the line