View source: R/plot-distribution.R
plot_distribution | R Documentation |
plot_priors_posts_mcmc()
Plot a distribution function. Mostly for use with making prior plots
for MCMC parameters. See plot_priors_posts_mcmc()
plot_distribution(
fun = dnorm,
nsamp = 100,
param_lst = list(mean = 0, sd = 0.5),
xlim = c(-2, 2),
fill = "steelblue",
title = "",
mode_line_col = "red",
mode_line_lwd = 0.5,
mode_line_lty = 1,
mean_line_col = "black",
mean_line_lwd = 0.5,
mean_line_lty = 1,
sd_lines_col = "black",
sd_lines_lwd = 0.5,
sd_lines_lty = 2,
alpha = 0.75,
show_mode_line = TRUE,
show_mean_line = TRUE,
show_sd_lines = TRUE
)
fun |
The function to plot |
nsamp |
Number of points across x-axis |
param_lst |
A list of parameters required by the function provided ( |
xlim |
x-axis limits (2-element vector) |
fill |
Fill color for under the curve |
title |
Plot title |
mode_line_col |
Mode line color |
mode_line_lwd |
Mode line width |
mode_line_lty |
Mode line type |
mean_line_col |
Mean line color |
mean_line_lwd |
Mean line width |
mean_line_lty |
Mean line type |
sd_lines_col |
Standard deviation lines color |
sd_lines_lwd |
Standard deviation lines width |
sd_lines_lty |
Standard deviation lines type |
alpha |
Opacity of fill from 0-1 |
show_mode_line |
Logical. If |
show_mean_line |
Logical. If |
show_sd_lines |
Logical. If |
The plot will contain a filled curve representing the prior distribution,
and a solid red (mode_line_col
) vertical line representing the mode of the distribution and a
solid black (mean_line_col
) and two dotted black (sd_lines_col
) vertical lines
representing the mean and one standard deviation from the mean
a ggplot2::ggplot()
object
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.