Description Usage Arguments Value See Also Examples
Plot multiple kernel density estimates in the same window, together with a legend
1 2 3 4 5 6 | multidensity(x, main, xlab = "", ylab = "Density", xlim, ylim,
col = 1:9, lty = 1:2, lwd = 1, add = FALSE, frame.plot = TRUE,
legend = TRUE, x.legend = "topleft", y.legend = NULL, bty = "o",
box.col = "#FFFFFF00", bg.legend = "#FFFFFFAA", cex.legend = 0.7,
x.intersp = 1, y.intersp = 1.5, inset = 0, xpd.legend = NA,
horiz = FALSE, ...)
|
x |
a list or data.frame of numeric values |
main |
a main title for the plot. Defaults to the call made
to |
xlab, ylab |
labels for the x and y axes |
xlim, ylim |
the x and y limits of the plot |
col, lty, lwd |
the line colours, types and widths for lines appearing in plot and legend |
add |
if |
frame.plot |
an integer indicating whether a box should be drawn around
the plot before the legend ( |
legend |
logical; if |
x.legend, y.legend |
the x and y co-ordinates to be used to position the legend. They can be specified by keyword or in any way which is accepted by xy.coords |
bty |
legend box type |
box.col |
line colour for the legend box |
bg.legend |
background colour for the legend box |
cex.legend |
character expanson faftor for legend |
x.intersp, y.intersp |
horizontal and vertical character interspacing for legend |
inset |
the legends inset distance from the margins as a fraction of the plot region |
xpd.legend |
the value of |
horiz |
logical; if |
... |
further arguments passed to |
An invisible list of the "density"
objects the plot is based on.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | set.seed(1)
dl <- list("Unif-1"=runif(80, -2.1, 2.1),
"Unif-2"=runif(70, -1.5, 1.5),
"Normal-1"=rnorm(50, 0, 0.866),
"Normal-2"=rnorm(90, 0, 1))
# sqrt((sd^2)*12) # sd to unif range
md <- multidensity(dl)
head(md, 2)
multidensity(dl, adj=1.2, x.leg="topright", frame=FALSE, inset=-0.02, lty=1)
multidensity(dl, x.legend="top", horiz=TRUE, cex.legend=0.5,
inset=-0.05, bg.legend="white")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.