breakColors(Heatplus)
breakColors()所属R语言包:Heatplus
Color palette for (symmetric) breaks
(对称)截断的调色板
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Given a vector of breaks specifying a set of intervals, this function provides a vector of colors for the indicating the intervals graphically. If the intervals are arranged symmetrically around a specified value, the colors try to reflect this.
由于向量的指定一组间隔截断,此功能显示的时间间隔图形的颜色提供了一个向量。如果围绕一个指定的值对称的间隔排列,颜色的尝试,以反映这一点。
用法----------Usage----------
breakColors(breaks, colors, center = 0, tol = 0.001)
参数----------Arguments----------
参数:breaks
a vector of breaks
的中断向量
参数:colors
either an explicit vector of colors, or a palette function that takes a number and returns a vector of colors
颜色向量要么是明确的,或者一个调色板功能,需要一个数字,并返回一个颜色的向量
参数:center
optional center around which to check for symmetry
可选围绕检查的对称性
参数:tol
tolerance (as relative error) for deviation from mathematically exact symmetry
从数学上精确的对称公差偏差(相对误差)
Details
详情----------Details----------
The meaning of symmetrical is rather generous here: it is enough that the intervals specified by breaks are of equal length and that center is one of the breaks. This means we allow for more or less intervals on one side of center.
对称的含义是相当慷慨的位置:它是足够指定的时间间隔breaks长度相等,而center是截断。这意味着我们允许更多或更少的时间间隔一个center一边。
This really only works well if colors is specified as g2r.colors, which returns a symmetrical color vector (from green to red) if an even number of colors is requested. The whole point is then that if there are more classes to one side of center than to the other, this will be reflected by deeper shades of red or green on the appropriate side.
这真的只是工作得很好,如果colorsg2r.colors,它返回一个对称的颜色矢量(从绿色到红色),如果要求颜色偶数指定。整点是,如果有更多的类的一侧center比其他,这将是更深的红色或绿色的深浅适当的反映。
值----------Value----------
A vector of colors, of length one less than the number of breaks.
各种颜色的向量,长度比截断数少。
参见----------See Also----------
g2r.colors
g2r.colors
举例----------Examples----------
## Fully symmetrical breaks[#全对称的截断]
br1 = (-3) : 3
co1 = breakColors(br1, g2r.colors)
co1
doLegend(br1, co1, 1)
## Truncated on one side[#截断一方]
br2 = (-2) : 4
co2 = breakColors(br2, g2r.colors)
co2
doLegend(br2, co2, 1)
## Does not work with other color schemes[#无法与其他配色方案]
co3 = breakColors(br2, heat.colors)
co3
doLegend(br2, co3, 1)
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|