# S3 method for distribution
autoplot(
x,
type = c("pdf", "cdf"),
n = 100,
quantile_range = c(0.001, 0.999),
...
)

Arguments

x The distribution(s) to plot. The type of plot to make (must be either "pdf" or "cdf"). The resolution (number of points) used to display the distribution. The range of the distribution (specified as quantiles). Unused.

Details

Visualise distribution(s) by plotting its probability density function (density()) or cumulative distribution function (cdf()). Note: This function currently only works for continuous distributions.

Examples

library(ggplot2)
dist <- c(dist_normal(mu = 0, sigma = 1), dist_student_t(df = 3))
autoplot(dist, type = "pdf")
#> Warning: autoplot.distribution() was deprecated in distributional 0.2.0.
#> The autoplot() method for distributions will be replaced by the {ggdist} package in an upcoming release.autoplot(dist, type = "cdf")