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. |
library("graphic") colors = grcolorscheme("grey") colors
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
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)
Shows a line of points with the newly created colors. Note that "freecolor" was used to deactivate all earlier defined colors.