原文地址:  plot col mns of matrices 图列的矩阵 译者:生物统计家园网 机器人lover 描述-description- plot the col mns of one matrix against the col mns 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, ...) 参数-arg ments- 参数:x,y vectors or matrices of data for plotting. the n mber of rows sho ld match. if one of them are missing, the other is taken as y and an x vector of 1:n is sed. missing val es (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 col mn 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 thro gh; 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 col mn, the second element for the second col mn, etc., even if lines are not plotted for all col mns. line types will be sed cyclically ntil 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 defa lt is the digits (1 thro gh 9, 0) then the lowercase and ppercase letters. 1个字符或整数的字符串或向量绘图字符,请参阅points.第一个字符是绘制的第一个图,第二次为第二个字符,默认为数字(1,0到9),然后是小写和大写字母. 参数:col vector of colors. colors are sed cyclically. 颜色矢量.颜色循环使用. 参数:cex vector of character expansion sizes, sed cyclically. this works as a m ltiple of par("cex"). null is eq ivalent to 1.0. 循环使用的字符扩大规模,向量.这作品作为par("cex")的倍数. null相当于1.0的. 参数:bg vector of backgro nd (fill) colors for the open plot symbols given by pch=21:25 as in points. the defa lt na corresponds to the one of the nderlying f nction 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 f rther arg ments of plot, typically plot.defa lt, may also be s pplied as arg ments to this f nction. hence, the high-level graphics control arg ments described nder par and the arg ments to title may be s pplied to this f nction. 图形参数(见par)plot任何进一步的论据,通常plot.defa lt,也可以作为这个函数的参数提供.因此,高层次的图形控制参数描述下par和title参数可提供此功能. 参数:add logical. if true, plots are added to c rrent one, sing points and lines. 逻辑.如果true,图被添加到当前,使用points和lines. 参数:verbose logical. if true, write one line of what is done. 逻辑.如果true,写一行做了什么. details 详情-details- points involving missing val es are not plotted. 遗漏值的点绘制. the first col mn of x is plotted against the first col mn of y, the second col mn of x against the second col mn of y, etc. if one matrix has fewer col mns, plotting will cycle back thro gh the col mns again. (in partic lar, either x or y may be a vector, against which all col mns of the other arg ment will be plotted.) 暗算x,第二列yx等对第二列如果一个矩阵的列数第一列的第一列y ,图将列循环回来. (特别是,无论是x或y可能是一个向量,对所有其他参数列将被绘制.) the first element of col, cex, lty, lwd is sed to plot the axes as well as the first line. col, cex, lty, lwd的第一个元素被用来绘制轴,以及第一线. beca se plotting symbols are drawn with lines and beca se these f nctions may be changing the line style, yo sho ld probably specify lty=1 when sing plotting symbols. 由于绘图符号用线条绘制,因为这些功能可以改变线的样式,你应该指定lty=1使用时绘制的符号. 副作用-side effects- f nction matplot generates a new plot; 功能matplot生成一个新的图; 参考文献-references- the new s lang age. wadsworth & brookscole. 参见-see also- plot, points, lines, matrix, par. plot,points,lines,matrix,par. 举例-examples- req ire(grdevices) matplot((-4:5)^2, main = "q adratic") # almost identical to plot(*)[几乎相同的图(*)] sines - o ter(1:20, 1:4, f nction(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:5050 matplot(x, o ter(x, 1:8, f nction(x, k) sin(k*pi * x)), ylim = c(-2,2), type = "plobcssh", main= "matplot(,type = "plobcssh" )") ## pch & type = vector of 1-chars :[#pch型= 1个字符的向量:] matplot(x, o ter(x, 1:4, f nction(x, k) sin(k*pi * x)), pch = letters[1:4], type = c("b","p","o")) lends - c("ro nd","b tt","sq are") 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 = "bisq e") 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), s b = paste(c("s", "c", "v"), dimnames(iris.s)[[3, sep = "=", collapse= ", "), main = "fisher s iris data") par(op) 转载请注明:出自 生物统计家园网. 注: 注1:为了方便大家学习,本文档为生物统计家园网机器人lover翻译而成,仅供个人r语言学习参考使用,生物统计家园保留版权. 注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中,英文内容进行反复理解,可以帮助r语言的学习. 注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订.