segments(graphics)
segments()所属R语言包:graphics
Add Line Segments to a Plot
添加线段的图
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Draw line segments between pairs of points.
对点之间绘制线段。
用法----------Usage----------
segments(x0, y0, x1 = x0, y1 = y0,
col = par("fg"), lty = par("lty"), lwd = par("lwd"),
...)
参数----------Arguments----------
参数:x0, y0
coordinates of points from which to draw.
坐标点,从中可以得出。
参数:x1, y1
coordinates of points to which to draw. At least one must be supplied.
坐标点,其中绘制。必须提供至少一个。
参数:col, lty, lwd
graphical parameters as in par, possibly vectors. NA values in col cause the segment to be omitted.
par,可能向量图形参数。 NA值col导致部分被省略。
参数:...
further graphical parameters (from par), such as xpd and the line characteristics lend, ljoin and lmitre.
进一步的图形参数(从par),如xpd和线路特性lend,ljoin和lmitre。
Details
详情----------Details----------
For each i, a line segment is drawn between the point (x0[i], y0[i]) and the point (x1[i], y1[i]). The coordinate vectors will be recycled to the length of the longest.
对于每个的i点(x0[i], y0[i])点(x1[i], y1[i])线段之间。坐标向量将被回收到的最长的长度。
The graphical parameters col, lty and lwd can be vectors of length greater than one and will be recycled if necessary.
图形参数col,lty和lwd可以是长度大于一向量,如有必要将回收。
参考文献----------References----------
The New S Language. Wadsworth & Brooks/Cole.
参见----------See Also----------
arrows, polygon for slightly easier and less flexible line drawing, and lines for the usual polygons.
arrows,polygon稍微更容易,更灵活的线描,lines通常的多边形。
举例----------Examples----------
x <- stats::runif(12); y <- stats::rnorm(12)
i <- order(x,y); x <- x[i]; y <- y[i]
plot(x, y, main="arrows(.) and segments(.)")
## draw arrows from point to point :[#绘制箭头从点对点:]
s <- seq(length(x)-1)# one shorter than data[一个短比数据]
arrows(x[s], y[s], x[s+1], y[s+1], col= 1:3)
s <- s[-length(s)]
segments(x[s], y[s], x[s+2], y[s+2], col= 'pink')
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|