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

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

[复制链接]
发表于 2012-2-17 09:43:32 | 显示全部楼层 |阅读模式
polypath(graphics)
polypath()所属R语言包:graphics

                                        Path Drawing
                                         路径图

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

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

path draws a path whose vertices are given in x and y.
path绘制路径的x和y给定的顶点。


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


polypath(x, y = NULL,
         border = NULL, col = NA, lty = par("lty"),
         rule = "winding", ...)



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

参数:x,y
vectors containing the coordinates of the vertices of the path.
向量路径的顶点的坐标。


参数:col
the color for filling the path. The default, NA, is to leave paths unfilled, unless density is specified.  (For back-compatibility, NULL is equivalent to NA.)  If density is specified with a positive value this gives the color of the shading lines.
颜色填充路径。默认情况下,NA,是离开路径悬空,除非density指定。 (对于向后兼容性,NULL相当于NA。)如果density是一个积极的价值,这使阴影线的颜色与指定。


参数:border
the color to draw the border.  The default, NULL, means to use par("fg").  Use border = NA to omit borders.  For compatibility with S, border can also be logical, in which case FALSE is equivalent to NA (borders omitted) and TRUE is equivalent to NULL (use the foreground colour),  
绘制边框的颜色。默认情况下,NULL,是指使用par("fg")。使用border = NA省略边框。与S的兼容性,border也可以是逻辑,在这种情况下,FALSE相当于NA(边框略)和TRUE是NULL(使用前景色),


参数:lty
the line type to be used, as in par.
要使用的线路类型,在par。


参数:rule
character value specifying the path fill mode: either "winding" or "evenodd".  
字符值指定的路径填充模式:要么"winding"或"evenodd"。


参数:...
graphical parameters such as xpd, lend, ljoin and lmitre can be given as arguments.
如xpd,lend,ljoin和lmitre图形参数可以作为参数。


Details

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

The coordinates can be passed in a plotting structure (a list with x and y components), a two-column matrix, ....  See xy.coords.
坐标可以通过在绘图结构(x和y组件的列表),一个两列的矩阵,...看到xy.coords。

It is assumed that the path is to be closed by joining the last point to the first point.
这是假设的路径是加入最后一点到第一点被关闭。

The coordinates can contain missing values.  The behaviour is similar to that of polygon, except that instead of breaking a polygon into several polygons, NA values break the path into several sub-paths (including closing the last point to the first point in each sub-path).  See the examples below.
坐标可以包含缺失值。类似的行为是polygon,除外,而不是分成几个多边形的多边形,NA值分解成几个子路径(包括关闭在每个最后一点到第一点的路径的子路径)。见下面的例子。

The distinction between a path and a polygon is that the former can contain holes, as interpreted by the fill rule; these fill a region if the path border encircles it an odd or non-zero number of times, respectively.
路径和多边形之间的区别是,前者可以包含孔,填充规则的解释,这些填充一个区域,如果路径边界围奇次或非零数字,分别。

Hatched shading (as implemented for polygon()) is not (currently) supported.
孵化阴影(执行)polygon()(目前)不支持。

Not all graphics devices support this function: for example xfig and pictex do not.
并非所有的图形设备支持此功能:例如xfig的和pictex不要。


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

The New S Language. Wadsworth & Brooks/Cole.


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

segments for even more flexibility, lines, rect, box, polygon.
segments更大的灵活性,lines,rect,box,polygon。

par for how to specify colors.
par如何指定颜色。


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


plotPath <- function(x, y, col = "grey", rule = "winding") {
    plot.new()
    plot.window(range(x, na.rm = TRUE), range(y, na.rm = TRUE))
    polypath(x, y, col = col, rule = rule)
    if (!is.na(col))
        mtext(paste("Rule:", rule), side = 1, line = 0)
}

plotRules <- function(x, y, title) {
    plotPath(x, y)
    plotPath(x, y, rule = "evenodd")
    mtext(title, side = 3, line = 0)
    plotPath(x, y, col = NA)
}

op <- par(mfrow = c(5, 3), mar = c(2, 1, 1, 1))

plotRules(c(.1, .1, .9, .9, NA, .2, .2, .8, .8),
          c(.1, .9, .9, .1, NA, .2, .8, .8, .2),
          "Nested rectangles, both clockwise")
plotRules(c(.1, .1, .9, .9, NA, .2, .8, .8, .2),
          c(.1, .9, .9, .1, NA, .2, .2, .8, .8),
          "Nested rectangles, outer clockwise, inner anti-clockwise")
plotRules(c(.1, .1, .4, .4, NA, .6, .9, .9, .6),
          c(.1, .4, .4, .1, NA, .6, .6, .9, .9),
          "Disjoint rectangles")
plotRules(c(.1, .1, .6, .6, NA, .4, .4, .9, .9),
          c(.1, .6, .6, .1, NA, .4, .9, .9, .4),
          "Overlapping rectangles, both clockwise")
plotRules(c(.1, .1, .6, .6, NA, .4, .9, .9, .4),
          c(.1, .6, .6, .1, NA, .4, .4, .9, .9),
          "Overlapping rectangles, one clockwise, other anti-clockwise")

par(op)

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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-1-23 05:59 , Processed in 0.066448 second(s), 15 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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