找回密码
 注册
查看: 2205|回复: 0

R语言:hcl()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-2-16 19:22:10 | 显示全部楼层 |阅读模式
hcl(grDevices)
hcl()所属R语言包:grDevices

                                        HCL Color Specification
                                         HCL色彩规范

                                         译者:生物统计家园网 机器人LoveR

描述----------Description----------

Create a vector of colors from vectors specifying hue, chroma and luminance.
创建一个颜色从指定的色调,色度和亮度的向量的向量。


用法----------Usage----------


hcl(h = 0, c = 35, l = 85, alpha, fixup = TRUE)



参数----------Arguments----------

参数:h
The hue of the color specified as an angle in the range [0,360].  0 yields red, 120 yields green 240 yields blue, etc.
角度范围在[0,360]中指定的颜色的色调。 0红,蓝绿色120产量240产量,单产等。


参数:c
The chroma of the color.  The upper bound for chroma depends on hue and luminance.
色度的颜色。上限为色度取决于色调和亮度。


参数:l
A value in the range [0,100] giving the luminance of the colour.  For a given combination of hue and chroma, only a subset of this range is possible.
范围值[0,100]颜色的亮度。对于给定的色调和色度的组合,只有这个范围的子集是可能的。


参数:alpha
numeric vector of values in the range [0,1] for alpha transparency channel (0 means transparent and 1 means opaque).
范围值的数字矢量[0,1]alpha透明通道(0手段透明,不透明和1表示)。


参数:fixup
a logical value which indicates whether the resulting RGB values should be corrected to ensure that a real color results. if fixup is FALSE RGB components lying outside the range [0,1] will result in an NA value.
一个逻辑值,这表明的结果RGB值是否应予以纠正,以确保真实的色彩效果。 fixup如果是FALSE RGB分量躺在范围以外的[0,1]将导致NA值。


Details

详情----------Details----------

This function corresponds to polar coordinates in the CIE-LUV color space. Steps of equal size in this space correspond to approximately equal perceptual changes in color.  Thus, hcl can be thought of as a perceptually based version of hsv.
此功能对应的CIE-LUV颜色空间中的极坐标。在这个空间的大小相等的步骤对应约等于感性的色彩变化。因此,hcl可以被认为是作为一个hsv感知的版本。

The function is primarily intended as a way of computing colors for filling areas in plots where area corresponds to a numerical value (pie charts, bar charts, mosaic plots, histograms, etc).  Choosing colors which have equal chroma and luminance provides a way of minimising the irradiation illusion which would otherwise produce a misleading impression of how large the areas are.
该功能主要用于灌装区的图,其中面积相当于一个数值(饼图,条形图,马赛克图,直方图等)的计算颜色的一种方式。选择的颜色有平等的色度和亮度,提供了一种方式尽量减少照射的错觉,否则就会产生一个多么大的区域是错误的印象。

The default values of chroma and luminance make it possible to generate a full range of hues and have a relatively pleasant pastel appearance.
色度的默认值和亮度,使人们有可能产生全方位的色调,并有一个比较愉快的柔和的外观。

The RGB values produced by this function correspond to the sRGB color space used on most PC computer displays.  There are other packages which provide more general color space facilities.
此功能所产生的RGB值对应于大多数PC电脑显示器上使用的sRGB色彩空间。有其他软件包提供了更一般的色彩空间设施。

Semi-transparent colors (0 < alpha < 1) are supported only on some devices: see rgb.
半透明的颜色(0 < alpha < 1)只在某些设备上的支持:见rgb。


值----------Value----------

A vector of character strings which can be used as color specifications by R graphics functions.
一个由R图形函数可以使用颜色规格的字符字符串的向量。


注意----------Note----------

At present there is no guarantee that the colours rendered by R graphics devices will correspond to their sRGB description. It is planned to adopt sRGB as the standard R color description in future.
目前还没有保证,由R图形设备呈现颜色会符合他们的sRGB描述。它计划采用的sRGB为标准R在未来的色彩描述。


作者(S)----------Author(s)----------


Ross Ihaka



参考文献----------References----------

Colour for Presentation Graphics, Proceedings of the 3rd International Workshop on Distributed Statistical Computing (DSC 2003), March 20-22, 2003, Technische Universit鋞 Wien, Vienna, Austria. http://www.ci.tuwien.ac.at/Conferences/DSC-2003.

参见----------See Also----------

hsv, rgb.
hsv,rgb。


举例----------Examples----------


require(graphics)

# The Foley and Van Dam PhD Data.[Foley和范达姆博士数据。]
csd <- matrix(c( 4,2,4,6, 4,3,1,4, 4,7,7,1,
                 0,7,3,2, 4,5,3,2, 5,4,2,2,
                 3,1,3,0, 4,4,6,7, 1,10,8,7,
                 1,5,3,2, 1,5,2,1, 4,1,4,3,
                 0,3,0,6, 2,1,5,5), nrow=4)

csphd <- function(colors)
  barplot(csd, col = colors, ylim = c(0,30),
          names = 72:85, xlab = "Year", ylab = "Students",
          legend = c("Winter", "Spring", "Summer", "Fall"),
          main = "Computer Science PhD Graduates", las = 1)

# The Original (Metaphorical) Colors (Ouch!)[原(隐喻)颜色(哎哟!)]
csphd(c("blue", "green", "yellow", "orange"))

# A Color Tetrad (Maximal Color Differences)[一个彩色的Tetrad(最大颜色差异)]
csphd(hcl(h = c(30, 120, 210, 300)))

# Same, but lighter and less colorful[相同的,但更轻,更丰富多彩]
# Turn off automatic correction to make sure[关闭自动校正,以确保]
# that we have defined real colors.[我们已经定义了真正的颜色。]
csphd(hcl(h = c(30, 120, 210, 300),
          c = 20, l = 90, fixup = FALSE))

# Analogous Colors[类似的颜色]
# Good for those with red/green color confusion[良好的红/绿颜色混乱]
csphd(hcl(h = seq(60, 240, by = 60)))

# Metaphorical Colors[隐喻色彩]
csphd(hcl(h = seq(210, 60, length = 4)))

# Cool Colors[冷色]
csphd(hcl(h = seq(120, 0, length = 4) + 150))

# Warm Colors[暖色调]
csphd(hcl(h = seq(120, 0, length = 4) - 30))

# Single Color[单一的颜色]
hist(stats::rnorm(1000), col = hcl(240))

转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。


注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|小黑屋|生物统计家园 网站价格

GMT+8, 2025-1-24 13:21 , Processed in 0.096506 second(s), 15 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表