Overlay Normal Density Plot
Overlay normal density plot (with the same mean and SD) to the density distribution of 'x'. This is useful for visually inspecting the degree of deviance from normality.
stat_overlay_normal_density( mapping = NULL, data = NULL, geom = "line", 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 |
geom |
The geometric object to use display the data |
position |
Position adjustment, either as a string, or the result of a call to a position adjustment function. |
na.rm |
If FALSE (the default), removes missing values with a warning. If TRUE silently removes missing values. |
show.legend |
logical. Should this layer be included in the legends?
|
inherit.aes |
If |
... |
other arguments to pass to |
# Simpledensity plot data("mtcars") ggdensity(mtcars, x = "mpg", fill = "red") + scale_x_continuous(limits = c(-1, 50)) + stat_overlay_normal_density(color = "red", linetype = "dashed") # Color by groups data(iris) ggdensity(iris, "Sepal.Length", color = "Species") + stat_overlay_normal_density(aes(color = Species), linetype = "dashed") # Facet ggdensity(iris, "Sepal.Length", facet.by = "Species") + stat_overlay_normal_density(color = "red", linetype = "dashed")
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.