Keywords - Function groups - @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

Library: graphic
See also: dispdot freecolor createcolor

Quantlet: grcolorscheme
Description: returns a vector of rgb colors.

Usage: outColors=grcolorscheme(inColorScheme {,ncol})
Input:
inColorScheme String. The color scheme to be returned. Valid are: "topographic" or "topo", "greyscale" or "grey", "spectrum" or "color", "bluered" or "br", "blue", "red", "green"
ncol scalar, number of colors (default = 9)
Output:
outColors n x 3 vector. Can be treated as rgb values for the colors of inColorScheme.

Note:

Example:
library("graphic")
colors = grcolorscheme("grey")
colors

Result:
Contents of colors

[1,]        0        0        0
[2,]       31       31       31
[3,]       63       63       63
[4,]       95       95       95
[5,]      127      127      127
[6,]      159      159      159
[7,]      191      191      191
[8,]      223      223      223
[9,]      255      255      255
Example:
library("graphic")
library("plot")
n=32
x=(1:n)~(1:n)
c=grcolorscheme("color", n)
freecolor()
createcolor(c)
setmaskp(x, c, 8, 15)
plot(x)

Result:
Shows a line of points with the newly created colors.
Note that "freecolor" was used to deactivate all earlier
defined colors.



Author: S. Lauer, Sigbert Klinke, M. Benko, W. Haerdle, 20001213 license MD*Tech
(C) MD*TECH Method and Data Technologies, 05.02.2006