Description Usage Arguments Value Author(s) Examples
Draw a Split Density Plot
1 2 3 |
x |
x vector from a density object. e.g. data <- rnorm(100); x <- density(data)$x |
y |
y vector from a density object |
densityObj |
an object created by the function density() |
yshift |
vertical shift to be applied to the y object |
colVec |
color vector for the shaded regions that compose the interior of the plot. The length of 'colVec' should be one greater than the length of split |
outerCol |
the color for the outer density line |
lwd |
line width for the outer density line |
split |
vector of x values at which to split the density plot |
yScale |
vertical scale at which to plot the density. For example, a call with 'yScale = 1' will produce a density curve scaled between 0 and 1 |
fillBackground |
binary specification of whether to fill in the background the outerCol color |
none. Graph is plotted to the current device
Jason Waddell
1 2 3 4 5 6 7 8 9 10 11 | library(RColorBrewer)
data <- rnorm(1000)
x <- density(data)$x
y <- density(data)$y
colVec <- brewer.pal(9, "Blues")[3:8]
outerCol <- brewer.pal(9, "Blues")[9]
oaTemplate(xlim = range(x), ylim = c(0, 1), ygrid = 0, cex.axis = 1.2)
drawSplitDensity(x, y, colVec = colVec, split = c(-8),
outerCol = outerCol,
yScale = 0.95, yshift = 0)
|
Loading required package: oaColors
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.