plot.multi.dens <- function(s) { junk.x = NULL junk.y = NULL for(i in 1:length(s)) { junk.x = c(junk.x, density(s[[i]])$x) junk.y = c(junk.y, density(s[[i]])$y) } xr <- range(junk.x) yr <- range(junk.y) plot(density(s[[1]]), xlim = xr, ylim = yr, main = "") for(i in 2:length(s)) { lines(density(s[[i]]), xlim = xr, ylim = yr, pch=plotChars[i], col=lineColors[i]) } }
Log in to post a comment.
plot.multi.dens <- function(s)
{
junk.x = NULL
junk.y = NULL
for(i in 1:length(s))
{
junk.x = c(junk.x, density(s[[i]])$x)
junk.y = c(junk.y, density(s[[i]])$y)
}
xr <- range(junk.x)
yr <- range(junk.y)
plot(density(s[[1]]), xlim = xr, ylim = yr, main = "")
for(i in 2:length(s))
{
lines(density(s[[i]]), xlim = xr, ylim = yr, pch=plotChars[i], col=lineColors[i])
}
}