palette(grDevices)
palette()所属R语言包:grDevices
Set or View the Graphics Palette
设置或查看图形调色板
译者:生物统计家园网 机器人LoveR
描述----------Description----------
View or manipulate the color palette which is used when a col= has a numeric index.
查看或操作调色板使用时col=有一个数字指标。
用法----------Usage----------
palette(value)
参数----------Arguments----------
参数:value
an optional character vector.
一个可选的特征向量。
Details
详情----------Details----------
If value has length 1, it is taken to be the name of a built in color palette. If value has length greater than 1 it is assumed to contain a description of the colors which are to make up the new palette (either by name or by RGB levels).
如果value长度为1,它是一个内置调色板的名称。如果value长度大于1,假定它包含的颜色,作出了新的调色板(按名称或RGB水平)的描述。
If value is omitted or has length 0, no change is made the current palette.
如果value被忽略或长度为0,是没有改变当前的调色板。
Currently, the only built-in palette is "default".
目前,只有内置的调色板是"default"。
值----------Value----------
The palette which was in effect. This is invisible unless the argument is omitted.
这实际上是调色板。这是invisible除非省略该参数。
参见----------See Also----------
colors for the vector of built-in named colors; hsv, gray, rainbow, terrain.colors,... to construct colors.
colors内置命名的颜色向量;hsv,gray,rainbow,terrain.colors,...以兴建颜色。
adjustcolor, e.g., for tweaking existing palettes; colorRamp to interpolate colors, making custom palettes; col2rgb for translating colors to RGB 3-vectors.
adjustcolor,例如,调整现有的调色板;colorRamp插颜色,自定义调色板;col2rgb的颜色转换到RGB三矢量。
举例----------Examples----------
require(graphics)
palette() # obtain the current palette[获得当前调色板]
palette(rainbow(6)) # six color rainbow[六色彩虹]
(palette(gray(seq(0,.9,len=25)))) # gray scales; print old palette[灰度打印旧调色板]
matplot(outer(1:100,1:30), type='l', lty=1,lwd=2, col=1:30,
main = "Gray Scales Palette",
sub = "palette(gray(seq(0,.9,len=25)))")
palette("default") # reset back to the default[重置回默认]
## on a device where alpha-transparency is supported,[#α-透明度支持的设备上,]
## use 'alpha = 0.3' transparency with the default palette :[#使用阿尔法= 0.3默认调色板的透明度:]
mycols <- adjustcolor(palette(), alpha.f = 0.3)
opal <- palette(mycols)
x <- rnorm(1000); xy <- cbind(x, 3*x + rnorm(1000))
plot (xy, lwd=2,
main = "Alpha-Transparency Palette\n alpha = 0.3")
xy[,1] <- -xy[,1]
points(xy, col=8, pch=16, cex = 1.5)
palette("default")
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|