densCols(grDevices)
densCols()所属R语言包:grDevices
Colors for Smooth Density Plots
颜色为光滑密度图
译者:生物统计家园网 机器人LoveR
描述----------Description----------
densCols produces a vector containing colors which encode the local densities at each point in a scatterplot.
densCols产生一个向量,包含颜色编码在散点图中的每个点的地方密度。
用法----------Usage----------
densCols(x, y = NULL, nbin = 128, bandwidth,
colramp = colorRampPalette(blues9[-(1:3)]))
blues9
参数----------Arguments----------
参数:x, y
the x and y arguments provide the x and y coordinates of the points. Any reasonable way of defining the coordinates is acceptable. See the function xy.coords for details. If supplied separately, they must be of the same length.
x和y参数提供的点x和y坐标。任何合理的方式是可以接受的定义的坐标。请参阅功能细节xy.coords。如果单独提供的,它们必须是相同的长度。
参数:nbin
numeric vector of length one (for both directions) or two (for x and y separately) specifying the number of equally spaced grid points for the density estimation; directly used as gridsize in bkde2D().
数值向量的长度为一(两个方向)或两个(分别为X和Y)指定的密度估计等距格点的数量;直接用于gridsizebkde2D()。
参数:bandwidth
numeric vector (length 1 or 2) of smoothing bandwidth(s). If missing, a more or less useful default is used. bandwidth is subsequently passed to function bkde2D.
数字矢量(长度为1或2)平滑(S)的带宽。如果失踪,或多或少有用的默认值。 bandwidth随后被传递给函数bkde2D。
参数:colramp
function accepting an integer n as an argument and returning n colors.
函数接受一个整数n作为参数和返回n颜色。
Details
详情----------Details----------
densCols computes and returns the set of colors that will be used in plotting, calling bkde2D(*, bandwidth, gridsize=nbin, ..) from package KernSmooth.
densCols计算并返回将在绘图中使用的颜色的集合,调用bkde2D(*, bandwidth, gridsize=nbin, ..)包KernSmooth。
blues9 is a set of 9 color shades of blue used as the default in plotting.
blues9是一组9作为策划的默认蓝色色调。
值----------Value----------
densCols returns a vector of length nrow(x) that contains colors to be used in a subsequent scatterplot. Each color represents the local density around the corresponding point.
densCols返回一个长度为向量nrow(x)包含在随后的散点图使用的颜色。每种颜色代表的对应点周围的局部密度。
作者(S)----------Author(s)----------
Florian Hahne at FHCRC, originally
参见----------See Also----------
bkde2D from package KernSmooth; further, smoothScatter() (package graphics) which builds on the same computations as densCols.
bkde2D包KernSmooth;进一步,smoothScatter()(包graphics)densCols相同计算基础。
举例----------Examples----------
x1 <- matrix(rnorm(1e3), ncol=2)
x2 <- matrix(rnorm(1e3, mean=3, sd=1.5), ncol=2)
x <- rbind(x1,x2)
dcols <- densCols(x)
graphics::plot(x, col = dcols, pch=20, main = "n = 1000")
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|