View source: R/plot_pdensity.R
plot_pdensity | R Documentation |
Quickly plot probability density function
plot_pdensity( fun, x = NULL, color = "skyblue", linetype = "solid", size = 1.5, fill = NA, alpha = 0.3, location = 0, p_limit = 0.001, lower_bound = -10000, upper_bound = 10000, ... )
fun |
A probability density function (e.g. |
x |
(Optional) A sequence of values for the probability density
function. If not supplied, the function will be plotted for all points
with probability density greater than |
color |
The color of the plotted line (default "skyblue"). |
linetype |
The linetype (default "solid"). |
size |
The size of the line (default 1.5). |
fill |
The color of the fill under the line (default NA = no fill) |
alpha |
The alpha transparency for the fill (default 0.3). |
location |
For probability density functions that do not have a location parameter, this will shift the center (zero) of that distribution to the specified location. |
p_limit |
The probability density cutoff for plotting. |
lower_bound |
The (potential) lower range of plotting subject to the
|
upper_bound |
The (potential) upper range of plotting subject to the
|
... |
Any additional parameters will be passed to the probability density function |
A ggplot gg
object.
plot_pdensity(dnorm) plot_pdensity(dnorm, seq(-3, 3, length.out = 100)) plot_pdensity(dbeta, shape1 = 2, shape2 = 2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.