make_multiple_density_plot: Multiple densities plot

View source: R/plot.R

make_multiple_density_plotR Documentation

Multiple densities plot

Description

Combine many density distributions to one common plot.

Usage

make_multiple_density_plot(
  densities,
  legend.title,
  title,
  x.axis.label,
  legend.size = 1
)

Arguments

densities

a list, each element holding the results from executing the density function to a (different) vector. Note that you need to provide a name for each list element for the legend (see example).

legend.title

string. The legend title.

title

string. The plot title.

x.axis.label

string. The x-axis label.

legend.size

numeric. Default value: 1.

Examples

mat = matrix(rnorm(60), ncol=20)
densities = apply(mat, 1, density)
names(densities) = c("1st", "2nd", "3rd")
make_multiple_density_plot(densities, legend.title = "Samples",
  x.axis.label = "", title = "3 Normal Distribution Samples")


usefun documentation built on Sept. 17, 2023, 9:06 a.m.