filledshape(shape)
filledshape()所属R语言包:shape
adds a colored shape to a plot
增加了一个花形的地积
译者:生物统计家园网 机器人LoveR
描述----------Description----------
plots outer and inner shape and colors inbetween; color can be a palette
绘制外部和内部的形状和颜色,它们中间的颜色可以是一个调色板
用法----------Usage----------
filledshape(xyouter, xyinner = colMeans(xyouter),
col = femmecol(100), values = NULL,
zlim = NULL, lcol = NA, lwd = 2, ...)
参数----------Arguments----------
参数:xyouter
2-column matrix with x,y values of outer shape.
x,y值的外部形状的2列的矩阵。
参数:xyinner
2-column matrix of 2-valued vector with x,y values of inner shape; default is centroid of xyouter.
2列的矩阵形心的二值向量的x,y值的内部形状;默认的xyouter。
参数:col
color palette to be used; also allowed are two extremes.
使用的调色板,也让两个极端。
参数:values
if not NULL, a matrix providing (radius,z-values) couples, used for coloring.
如果不是NULL,矩阵(半径,Z值)夫妇,用于着色。
参数:zlim
Only if values is not NULL: the minimum and maximum z values for which colors should be plotted, defaulting to the range of the finite values of the second column of *values*.
只有values非NULL:最小和最大z值的颜色应该被绘制,默认的范围的有限值,第二列的*值*。
参数:lcol
line color.
线的颜色。
参数:lwd
width of external line, only if lcol != NA.
复杂的外部连线,宽度只有lcol!=NA。
参数:...
arguments passed to R-function polygon
参数传递函数R-多边形
Details
详细信息----------Details----------
draws and outer and inner shape, as specified in xyouter, and xyinner and fills with a palette of colors inbetween;
平中指定的xyouter,xyinner外部和内部形状,充满了的调色板,色彩之间;
values: if not null, a matrix providing (radius,z-values) couples, used for coloring. Here radius are positive values denoting the relative distance between the shapes centre and edge. The radiusses are rescaled to be in [0,1] if needed. z-values (2nd column of values) together with zlim and col denote the coloration level.
values:如果不为null,矩阵提供(半径,Z值)夫妇,用于着色。这里半径是正的值,表示的形状的中心和边缘之间的相对距离。重新调整的radiusses是在[0,1]如果需要的话。 z值(第二列values)一起zlim和col表示显色程度。
Colors in col will be interpolated to the z-values and used to color an interval as given by the input radiusses.
颜色在col将被内插的z值,并用于到如由输入radiusses给出一个区间着色。
If xyinner is a point, the shape is full.
如果xyinner是一个点,形状是完整的。
(作者)----------Author(s)----------
Karline Soetaert <karline.soetaert@nioz.nl>
参见----------See Also----------
filledellipse, filledcylinder
filledellipse,filledcylinder
实例----------Examples----------
#an egg[一个鸡蛋]
color <-greycol(100)
emptyplot(c(-3.2, 3.2), col = color[length(color)], main = "filledshape")
b <- 4
a <- 9
x <- seq(-sqrt(a), sqrt(a), by = 0.01)
g <- b-b/a*x^2 - 0.2*b*x + 0.2*b/a*x^3
g[g<0] <- 0
x1 <- c(x, rev(x))
g1 <- c(sqrt(g), rev(-sqrt(g)))
xouter <- cbind(x1, g1)
xouter <- rbind(xouter, xouter[1,])
filledshape(xouter, xyinner = c(-1, 0), col = color)
# a mill[一个工厂]
color <- shadepalette(grey(0.3), "yellow", n = 50)
emptyplot(c(-3.3, 3.3), col = color[length(color)], main = "filledshape")
x <- seq(0, 0.8*pi, pi/100)
y <- sin(x)
xouter <- cbind(x, y)
for (i in seq(0, 360, 60))
xouter <- rbind(xouter, rotatexy(cbind(x, y), mid = c(0, 0), angle = i))
filledshape(xouter, c(0, 0), col = color)
# abstract art[抽象主义]
emptyplot(col = "darkgrey", main = "filledshape")
filledshape(matrix(ncol = 2, runif(100)), col = "darkblue")
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|