Learn R Programming

cancerTiming (version 3.1.8)

multidensity: plot multiple density functions on top of each other

Description

plots multiple density functions on top of each other, calculating the correct xlim, ylim, etc.

Usage

multidensity(x, col = palette(), lwd = 1, lty = 1, xlim, ylab = "Density", ...)

Arguments

x
list of values to create density from (can be a data.frame which where columns are elements of the list)

col
colors for each density plot

lwd
lwd for each density plot

lty
lty for each density plot

xlim
user defined xlim

ylab
user defined ylab

...
plotting parameters passed to initial plot command.

Examples

Run this code
x<-lapply(c(1,2,3),function(x){rnorm(100,mean=x)})
multidensity(x)

Run the code above in your browser using DataLab