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

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

[复制链接]
发表于 2012-2-16 21:18:50 | 显示全部楼层 |阅读模式
matplot(graphics)
matplot()所属R语言包:graphics

                                        Plot Columns of Matrices
                                         图列的矩阵

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

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

Plot the columns of one matrix against the columns of another.
暗算另一列的一个矩阵的列。


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


matplot(x, y, type = "p", lty = 1:5, lwd = 1, lend = par("lend"),
        pch = NULL,
        col = 1:6, cex = NULL, bg = NA,
        xlab = NULL, ylab = NULL, xlim = NULL, ylim = NULL,
        ..., add = FALSE, verbose = getOption("verbose"))

matpoints(x, y, type = "p", lty = 1:5, lwd = 1, pch = NULL,
          col = 1:6, ...)

matlines (x, y, type = "l", lty = 1:5, lwd = 1, pch = NULL,
          col = 1:6, ...)



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

参数:x,y
vectors or matrices of data for plotting.  The number of rows should match.  If one of them are missing, the other is taken as y and an x vector of 1:n is used. Missing values (NAs) are allowed.
向量或矩阵数据的图。应匹配的行数。如果其中一人失踪,另一种是作为y和x向量1:n使用。遗漏值(NAS)是允许的。


参数:type
character string (length 1 vector) or vector of 1-character strings indicating the type of plot for each column of y, see plot for all possible types.  The first character of type defines the first plot, the second character the second, etc. Characters in type are cycled through; e.g., "pl" alternately plots points and lines.
字符串(长度为1的向量)或1个字符表示图每个y列类型的字符串矢量,看到plot为所有可能的type的。 type的第一个字符定义的第一个图,第二个字符的第二等特征type循环,例如"pl"交替图点和线。


参数:lty,lwd,lend
vector of line types, widths, and end styles. The first element is for the first column, the second element for the second column, etc., even if lines are not plotted for all columns. Line types will be used cyclically until all plots are drawn.
矢量线类型,宽度和最终样式。第一个元素是第一列,第二列,等第二个元素,即使行不绘制的所有列。线路类型将循环使用,直到所有的图绘制。


参数:pch
character string or vector of 1-characters or integers for plotting characters, see points. The first character is the plotting-character for the first plot, the second for the second, etc.  The default is the digits (1 through 9, 0) then the lowercase and uppercase letters.      
1个字符或整数的字符串或向量绘图字符,请参阅points。第一个字符是绘制的第一个图,第二次为第二个字符,默认为数字(1,0到9),然后是小写和大写字母。


参数:col
vector of colors.  Colors are used cyclically.
颜色矢量。颜色循环使用。


参数:cex
vector of character expansion sizes, used cyclically. This works as a multiple of par("cex").  NULL is equivalent to 1.0.  
循环使用的字符扩大规模,向量。这作品作为par("cex")的倍数。 NULL相当于1.0的。


参数:bg
vector of background (fill) colors for the open plot symbols given by pch=21:25 as in points.  The default NA corresponds to the one of the underlying function plot.xy.
矢量背景(填充)为开放式小区在pch=21:25points符号的颜色。默认NA对应一个底层函数plot.xy。


参数:xlab, ylab
titles for x and y axes, as in plot.
X和Y轴,标题作为plot。


参数:xlim, ylim
ranges of x and y axes, as in plot.
X和Y轴的范围,在plot。


参数:...
Graphical parameters (see par) and any further arguments of plot, typically plot.default, may also be supplied as arguments to this function.  Hence, the high-level graphics control arguments described under par and the arguments to title may be supplied to this function.
图形参数(见par)plot任何进一步的论据,通常plot.default,也可以作为这个函数的参数提供。因此,高层次的图形控制参数描述下par和title参数可提供此功能。


参数:add
logical.  If TRUE, plots are added to current one, using points and lines.
逻辑。如果TRUE,图被添加到当前,使用points和lines。


参数:verbose
logical.  If TRUE, write one line of what is done.
逻辑。如果TRUE,写一行做了什么。


Details

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

Points involving missing values are not plotted.
遗漏值的点绘制。

The first column of x is plotted against the first column of y, the second column of x against the second column of y, etc.  If one matrix has fewer columns, plotting will cycle back through the columns again.  (In particular, either x or y may be a vector, against which all columns of the other argument will be plotted.)
暗算x,第二列yx等对第二列如果一个矩阵的列数第一列的第一列y ,图将列循环回来。 (特别是,无论是x或y可能是一个向量,对所有其他参数列将被绘制。)

The first element of col, cex, lty, lwd is used to plot the axes as well as the first line.
col, cex, lty, lwd的第一个元素被用来绘制轴,以及第一线。

Because plotting symbols are drawn with lines and because these functions may be changing the line style, you should probably specify lty=1 when using plotting symbols.
由于绘图符号用线条绘制,因为这些功能可以改变线的样式,你应该指定lty=1使用时绘制的符号。


副作用----------Side Effects----------

Function matplot generates a new plot;
功能matplot生成一个新的图;


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

The New S Language. Wadsworth & Brooks/Cole.

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

plot, points, lines, matrix, par.
plot,points,lines,matrix,par。


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


require(grDevices)
matplot((-4:5)^2, main = "Quadratic") # almost identical to plot(*)[几乎相同的图(*)]
sines <- outer(1:20, 1:4, function(x, y) sin(x / 20 * pi * y))
matplot(sines, pch = 1:4, type = "o", col = rainbow(ncol(sines)))
matplot(sines, type = "b", pch = 21:23, col = 2:5, bg = 2:5,
        main = "matplot(...., pch = 21:23, bg = 2:5)")

x <- 0:50/50
matplot(x, outer(x, 1:8, function(x, k) sin(k*pi * x)),
        ylim = c(-2,2), type = "plobcsSh",
        main= "matplot(,type = \"plobcsSh\" )")
## pch &amp; type =  vector of 1-chars :[#PCH型= 1个字符的向量:]
matplot(x, outer(x, 1:4, function(x, k) sin(k*pi * x)),
        pch = letters[1:4], type = c("b","p","o"))

lends <- c("round","butt","square")
matplot(matrix(1:12, 4), type="c", lty=1, lwd=10, lend=lends)
text(cbind(2.5, 2*c(1,3,5)-.4), lends, col= 1:3, cex = 1.5)

table(iris$Species) # is data.frame with 'Species' factor[“种”的因素是数据框]
iS <- iris$Species == "setosa"
iV <- iris$Species == "versicolor"
op <- par(bg = "bisque")
matplot(c(1, 8), c(0, 4.5), type= "n", xlab = "Length", ylab = "Width",
        main = "Petal and Sepal Dimensions in Iris Blossoms")
matpoints(iris[iS,c(1,3)], iris[iS,c(2,4)], pch = "sS", col = c(2,4))
matpoints(iris[iV,c(1,3)], iris[iV,c(2,4)], pch = "vV", col = c(2,4))
legend(1, 4, c("    Setosa Petals", "    Setosa Sepals",
               "Versicolor Petals", "Versicolor Sepals"),
       pch = "sSvV", col = rep(c(2,4), 2))

nam.var <- colnames(iris)[-5]
nam.spec <- as.character(iris[1+50*0:2, "Species"])
iris.S <- array(NA, dim = c(50,4,3),
                dimnames = list(NULL, nam.var, nam.spec))
for(i in 1:3) iris.S[,,i] <- data.matrix(iris[1:50+50*(i-1), -5])

matplot(iris.S[,"Petal.Length",], iris.S[,"Petal.Width",], pch="SCV",
        col = rainbow(3, start = .8, end = .1),
        sub = paste(c("S", "C", "V"), dimnames(iris.S)[[3]],
                    sep = "=", collapse= ",  "),
        main = "Fisher's Iris Data")
par(op)

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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-1-23 21:18 , Processed in 0.023893 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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