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

R语言 shape包 Arrows()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-9-30 01:52:57 | 显示全部楼层 |阅读模式
Arrows(shape)
Arrows()所属R语言包:shape

                                         adds arrows with improved arrowhead to a plot
                                         添加箭头,与改进箭头的图

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

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

adds one or more arrows  to a plot; arrowhead shape is either curved, a triangle, a circle or simple
添加一个或多个箭头的图;要么是弯曲的箭头形状,三角形,圆形或简单


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


Arrows(x0, y0, x1, y1, code = 2, arr.length = 0.4,
  arr.width = arr.length/2, arr.adj = 0.5, arr.type = "curved",
  segment = TRUE, col = "black", lcol = col, lty = 1, arr.col = lcol,
  lwd = 1, arr.lwd = lwd, ...)



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

参数:x0
x-coordinates of points *from* which to draw arrows; either one value or a vector.  
的点的x坐标*从*绘制箭头的任一个值或一个矢量。


参数:y0
y-coordinates of points *from* which to draw arrows; either one value or a vector.  
的点的y坐标*从*绘制箭头的任一个值或一个矢量。


参数:x1
x-coordinates of points *to* which to draw arrows; either one value or a vector.  
的点的x坐标*到*其中绘制的箭头;的任一个值或一个矢量。


参数:y1
y-coordinates of points *to* which to draw arrows; either one value or a vector.  
的点的y坐标* *其中绘制的箭头;的任一个值或一个矢量。


参数:code
integer code determining kind of arrows to draw.  
整数代码确定种箭头画。


参数:arr.length
approximate length of arrowhead, in cm; either one value or a vector.  
近似长度的箭头,以厘米为一个值或一个矢量。


参数:arr.width
approximate width of arrowhead, in cm; either one value or a vector.  
箭头,在近似宽度厘米;的任一个值或一个矢量。


参数:arr.adj
0,0.5,1 specifying the adjustment of the arrowhead.  
0,0.5,1指定的箭头的调整。


参数:arr.type
type of arrowhead to draw, one of "simple", "curved", "triangle", "circle", "ellipse" or "T".  
类型的箭头画,“简单”,“弯曲”,“三角”,“圆”,“椭圆”或“T”。


参数:segment
logical specifying whether or not to draw line segments.  
逻辑指定是否要绘制线段。


参数:col
general line color specification; one value or a vector.  
一般线的颜色指定一个值或一个向量。


参数:lcol
line color specifications; either one value or a vector. ignored when arr.type = "simple" or "T" - use "col"  
线的颜色规格,任何一个值或一个向量。忽略时arr.type ="simple"或"T"  - 使用“山坳”


参数:lty
line type specifications; either one value or a vector.  
线路类型规格;任何一个值或一个向量。


参数:arr.col
color of arrowhead; either one value or a vector.  
颜色的箭头;的任一个值或一个矢量。


参数:lwd
general line width specification.  The default value changed to 1 from version 1.4 (was 2)   
总路线宽度规范。默认值更改为1,从1.4版本(2)


参数:arr.lwd
line width of arrowhead.  
直线宽度的箭头。


参数:...
arguments passed to lines or segments function.  
线或分段函数参数传递给。


Details

详细信息----------Details----------

x0, y0, x1, y1, arr.length, arr.width, arr.adj, lcol, lty and arr.col can be a vector, of the same length.
x0,y0,x1,y1,arr.length,arr.width,arr.adj,lcol,lty和arr.col可以是一个矢量,具有相同的长度。

For each 'i', an arrow is drawn between the point '(x0[i], y0[i])' and the point '(x1[i],y1[i])'.
对于每一个的“i”,绘制一个箭头之间的点“(X0 [i]的,Y0的[i]的)”和点“(×1 [i]的,Y1 [])。

If code=1 an arrowhead is drawn at '(x0[i],y0[i])'
如果code = 1箭头绘制在(X0 [I],Y0 [I])

if code=2 an arrowhead is drawn at '(x1[i],y1[i])'.
如果code= 2在“画箭头(X1 [I],Y1 [I])。

If code=3 an arrowhead is drawn at both ends of the arrow
如果code= 3箭头绘制的箭头的两端

unless arr.length = 0, when no head is drawn.
除非arr.length= 0,当没有头绘制。

If arr.adj = 0.5 then the centre of the arrowhead is at the point at which it is drawn.
如果arr.adj= 0.5,则中心的箭头是在它被绘制在点。

arr.adj = 1 causes the tip of the arrowhead to touch the point.
arr.adj= 1导致的箭头的前端接触的点。

arr.adj = 2 causes the base of the arrowhead to touch the point.
arr.adj= 2的原因的箭头的基础上触摸的点。

The type of the arrowhead is set with arr.type which can take the values:
类型的箭头arr.type的值可以取:

"simple"  : uses comparable R function arrows
“简单”:使用可比性的R功能箭头

"triangle": uses filled triangle
“三角”:使用实心三角形

"curved"  : draws arrowhead with curved edges
“曲线”:绘制箭头弯曲的边缘

"circle"  : draws circular head
“圈子”:绘制圆形头

"ellipse" : draws ellepsoid head
“椭圆形”:绘制ellepsoid的头

"T"       : draws T-shaped (blunt) head
“T”:绘制T形头(冲服)


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



Karline Soetaert <karline.soetaert@nioz.nl>




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

arrows the comparable R function
arrows可比性的R功能

Arrowhead
Arrowhead


实例----------Examples----------


xlim <- c(-5 , 5)
ylim <- c(-10, 10)
plot(0, type = "n", xlim = xlim, ylim = ylim,
     main = "Arrows,  type = 'curved'")
x0 <- runif(100, xlim[1], xlim[2])
y0 <- runif(100, ylim[1], ylim[2])
x1 <- x0+runif(100, -1, 1)
y1 <- y0+runif(100, -1, 1)
Arrows(x0, y0, x1, y1, arr.length = runif(100), code = 2,
       arr.type = "curved", arr.col = 1:100, lcol = 1:100)
  
plot(0, type = "n", xlim = xlim, ylim = ylim,
     main = "Arrows,  type = 'circle'")
x0 <- runif(100, xlim[1], xlim[2])
y0 <- runif(100, ylim[1], ylim[2])
x1 <- x0 + runif(100, -1, 1)
y1 <- y0 + runif(100, -1, 1)
Arrows(x0, y0, x1, y1, arr.length = 0.2, code = 3,
       arr.type = "circle", arr.col = "grey")
  
plot(0, type = "n", xlim = xlim, ylim = ylim,
     main = "Arrows,  type = 'ellipse'")
Arrows(x0, y0, x1, y1, arr.length = 0.2, arr.width = 0.5,
       code = 3, arr.type = "ellipse",  arr.col = "grey")

curve(expr = sin(x), 0, 2*pi+0.25, main = "Arrows")
x  <- seq(0, 2*pi, length.out = 10)
xd <- x + 0.025
Arrows(x, sin(x), xd, sin(xd), type = "triangle",
       arr.length = 0.5, segment = FALSE)
  
xx <- seq(0, 10*pi, length.out = 1000)
plot(sin(xx)*xx, cos(xx)*xx, type = "l", axes = FALSE,
     xlab = "", ylab = "", main = "Arrows,  type = 'curved'")
x  <- seq(0, 10*pi, length.out = 20)
x1 <- sin(x)*x
y1 <- cos(x)*x
xd <- x+0.01
x2 <- sin(xd)*xd
y2 <- cos(xd)*xd
Arrows(x1, y1, x2, y2, arr.type = "curved", arr.length = 0.4,
       segment = FALSE, code = 1, arr.adj = 0.5 )

plot(sin(xx)*xx, cos(xx)*xx, type = "l", axes = FALSE,
     xlab = "", ylab = "", main = "Arrows,  type = 'T'")
Arrows(x1, y1, x2, y2, arr.type = "T", arr.length = 0.4,
       code = 1, arr.lwd = 2)


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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-5-22 06:46 , Processed in 0.023781 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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