Description Usage Arguments Value Author(s) See Also Examples
Generated grayscales from a vector of values specified by argument
x. The interval the values can span can be specified by the
argument x.range. Everything outside the range is safely
thresholded. If x.range is NULL, the range of x
will be used. The interval of the grayscale generated can be specified
by the argument dim.range. By default this is the full grayscale
range, i.e. [0,1].
The returned colors has the same dimensions as argument x.
| 1 | 
| x | A matrix of size N, where N is the number of data values. | 
| x.range | A vector of length two. | 
| dim.range | A vector of length two. | 
| ... | Not used. | 
Returns a vector of character strings of length equal to the number of
rows (or the length) of x. The resulting vector contains character
strings of format "#nnnnnn" where n is a hexadecimal digit.
Henrik Bengtsson (http://www.braju.com/R/)
*getHSV(),
*getRGB().
gray.
For more information see Colors.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | data(volcano)
z <- 2 * volcano        # Exaggerate the relief
x <- 10 * (1:nrow(z))   # 10 meter spacing (S to N)
y <- 10 * (1:ncol(z))   # 10 meter spacing (E to W)
phi=40
theta=40
opar <- par(mar=c(2,1,2,1)+0.1)
layout(matrix(1:6, nrow=2, ncol=3))
persp(x,y,z, col=Colors$getGray(z)[-1,-1], border=NA, phi=phi, theta=theta)
title("Colors$getGray()")
persp(x,y,z, col=Colors$getTopoColors(z)[-1,-1], border=NA, phi=phi, theta=theta)
title("Colors$getTopoColors()")
persp(x,y,z, col=Colors$getTerrainColors(z)[-1,-1], border=NA, phi=phi, theta=theta)
title("Colors$getTerrainColors()")
persp(x,y,z, col=Colors$getHeatColors(z)[-1,-1], border=NA, phi=phi, theta=theta)
title("Colors$getHeatColors()")
persp(x,y,z, col=Colors$getRainbowColors(z)[-1,-1], border=NA, phi=phi, theta=theta)
title("Colors$getRainbowColors()")
persp(x,y,z, col=Colors$getCyanMagentaColors(z)[-1,-1], border=NA, phi=phi, theta=theta)
title("Colors$getCyanMagentaColors()")
par(opar)
 | 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.