Description Usage Arguments Details Value See Also Examples
The functions create a vector of n
"contiguous" colors (except the
color.mixo
which are colors used internally to fit our logo colors).
1 | color.jet(n, alpha = 1)
|
n |
an integer, the number of colors (≥q 1) to be in the palette. |
alpha |
a numeric value between 0 and 1 for alpha channel (opacity). |
num.vector |
for |
The function color.jet(n)
create color scheme, beginning with dark
blue, ranging through shades of blue, cyan, green, yellow and red, and
ending with dark red. This colors palette is suitable for displaying ordered
(symmetric) data, with n
giving the number of colors desired.
For color.jet(n)
, color.spectral(n)
,
color.GreenRed(n)
a character vector, cv
, of color names. This
can be used either to create a user-defined color palette for subsequent
graphics by palette(cv)
, a col=
specification in graphics
functions or in par
.
For color.mixo
, a vector of colors matching the mixOmics logo (10
colors max.)
colorRamp
, palette
,
colors
for the vector of built-in "named" colors;
hsv
, gray
, rainbow
,
terrain.colors
, ... to construct colors; and
heat.colors
, topo.colors
for images.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | # -----------------------
# jet colors
# ----------------------
par(mfrow = c(3, 1))
z <- seq(-1, 1, length = 125)
for (n in c(11, 33, 125)) {
image(matrix(z, ncol = 1), col = color.jet(n),
xaxt = 'n', yaxt = 'n', main = paste('n = ', n))
box()
par(usr = c(-1, 1, -1, 1))
axis(1, at = c(-1, 0, 1))
}
## Not run:
# -----------------------
# spectral colors
# ----------------------
par(mfrow = c(3, 1))
z <- seq(-1, 1, length = 125)
for (n in c(11, 33, 125)) {
image(matrix(z, ncol = 1), col = color.spectral(n),
xaxt = 'n', yaxt = 'n', main = paste('n = ', n))
box()
par(usr = c(-1, 1, -1, 1))
axis(1, at = c(-1, 0, 1))
}
# -----------------------
# GreenRed colors
# ----------------------
par(mfrow = c(3, 1))
z <- seq(-1, 1, length = 125)
for (n in c(11, 33, 125)) {
image(matrix(z, ncol = 1), col = color.GreenRed(n),
xaxt = 'n', yaxt = 'n', main = paste('n = ', n))
box()
par(usr = c(-1, 1, -1, 1))
axis(1, at = c(-1, 0, 1))
}
# # --------------------------------
# mixOmics colors
# # -------------------------------
X <- nutrimouse$lipid
Y <- nutrimouse$gene
nutri.res <- rcc(X, Y, ncomp = 3, lambda1 = 0.064, lambda2 = 0.008)
my.colors = color.mixo(1:5)
my.pch = ifelse(nutrimouse$genotype == 'wt', 16, 17)
#plotIndiv(nutri.res, ind.names = FALSE, group = my.colors, pch = my.pch, cex = 1.5)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.