Description Usage Arguments Value Author(s) References See Also Examples
Creates a color palette for plotting functions in the mcmcplots package using functions in the colorspace package.
1 2 | mcmcplotsPalette(n, type = c("rainbow", "sequential",
"grayscale"), seq = NULL)
|
n |
number of colors |
type |
denotes the type of color palette to create. |
seq |
deprecated |
A color palette of n
colors.
S. McKay Curtis
Zeileis, A., Hornik, K. and Murrell, P. (2009) "Escaping RGBland: Selecting colors for statistical graphs." Compuational Statistics & Data Analysis, 53, 3259–3270.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | colorpie <- function(n, type="rainbow") pie(rep(1, n), col=mcmcplotsPalette(n, type=type))
colorpie(1)
colorpie(8)
colorpie(4, type="sequential")
colorpie(4, type="grayscale")
## Create fake MCMC output
nc <- 10; nr <- 1000
pnames <- c(paste("alpha[", 1:5, "]", sep=""), paste("gamma[", 1:5, "]", sep=""))
means <- rpois(10, 20)
fakemcmc <- coda::as.mcmc.list(
lapply(1:3,
function(i) coda::mcmc(matrix(rnorm(nc*nr, rep(means,each=nr)),
nrow=nr, dimnames=list(NULL,pnames)))))
denplot(fakemcmc)
denplot(fakemcmc, style="plain", col=mcmcplotsPalette(3, type="sequential"))
denplot(fakemcmc, style="plain", col=mcmcplotsPalette(3, type="grayscale"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.