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

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

[复制链接]
发表于 2012-9-29 22:48:57 | 显示全部楼层 |阅读模式
scatterplot3d(scatterplot3d)
scatterplot3d()所属R语言包:scatterplot3d

                                        3D Scatter Plot
                                         3D散点图

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

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

Plots a three dimensional (3D) point cloud.
绘制一个三维(3D)的点云。


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


scatterplot3d(x, y=NULL, z=NULL, color=par("col"), pch=NULL,
    main=NULL, sub=NULL, xlim=NULL, ylim=NULL, zlim=NULL,
    xlab=NULL, ylab=NULL, zlab=NULL, scale.y=1, angle=40,
    axis=TRUE, tick.marks=TRUE, label.tick.marks=TRUE,
    x.ticklabs=NULL, y.ticklabs=NULL, z.ticklabs=NULL,
    y.margin.add=0, grid=TRUE, box=TRUE, lab=par("lab"),
    lab.z=mean(lab[1:2]), type="p", highlight.3d=FALSE,
    mar=c(5,3,4,3)+0.1, col.axis=par("col.axis"),
    col.grid="grey", col.lab=par("col.lab"),
    cex.symbols=par("cex"), cex.axis=0.8 * par("cex.axis"),
    cex.lab=par("cex.lab"), font.axis=par("font.axis"),
    font.lab=par("font.lab"), lty.axis=par("lty"),
    lty.grid=par("lty"), lty.hide=NULL, lty.hplot=par("lty"),
    log="", ...)



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

参数:x
the coordinates of points in the plot.
在图中的坐标点。


参数:y
the y coordinates of points in the plot, optional if x is an appropriate structure.
的y坐标点中的图,可选的x是一个适当的结构。


参数:z
the z coordinates of points in the plot, optional if x is an appropriate structure.
Z坐标点中的图,可选的x是一个适当的结构。


参数:color
colors of points in the plot, optional if x is an appropriate structure. Will be ignored if highlight.3d = TRUE.
颜色的点,在图中,可选的,如果x是一个适当的结构。将被忽略highlight.3d = TRUE。


参数:pch
plotting "character", i.e. symbol to use.
策划“性格”,即符号使用。


参数:main
an overall title for the plot.
总冠军的图。


参数:sub
sub-title.
子标题。


参数:xlim, ylim, zlim
the x, y and z limits (min, max) of the plot. Note that setting enlarged limits  may not work as exactly as expected (a known but unfixed bug).
在x,y和z限制(最小值,最大值)的图。请注意,设置扩大的限制可能无法正常工作完全按预期(已知但不固定的错误)。


参数:xlab, ylab, zlab
titles for the x, y and z axis.
的x,y和z轴的标题。


参数:scale.y
scale of y axis related to x- and z axis.
规模相关的x和z轴的y轴。


参数:angle
angle between x and y axis (Attention: result depends on scaling).
X和Y轴(注意:结果将取决于缩放)之间的夹角。


参数:axis
a logical value indicating whether axes should be drawn on the plot.
一个逻辑值,该值指示是否应制定轴的图。


参数:tick.marks
a logical value indicating whether tick marks should be drawn on the plot (only if axis = TRUE).
一逻辑值,该值指示刻度线是否应该被绘制在图上(只有axis = TRUE“)。


参数:label.tick.marks
a logical value indicating whether tick marks should be labeled on the plot (only if axis = TRUE and tick.marks = TRUE).
一逻辑值,该值指示刻度线是否应在图上标有(只有axis = TRUE和tick.marks = TRUE)。


参数:x.ticklabs, y.ticklabs, z.ticklabs
vector of tick mark labels.
矢量的刻度标记标签。


参数:y.margin.add
add additional space between tick mark labels and axis label of the y axis
刻度标记标签和y轴的轴标签之间添加额外的空间


参数:grid
a logical value indicating whether a grid should be drawn on the plot.
一个逻辑值,该值指示是否应绘制在图上的网格。


参数:box
a logical value indicating whether a box should be drawn around the plot.
一个逻辑值,该值指示是否应制定一个盒子,周围的图。


参数:lab
a numerical vector of the form c(x, y, len).  The values of x and y give the (approximate) number of tickmarks on the x and y axes.
一个数值向量的形式为c(X,Y,LEN)。 x和y的值,得到的(近似)上的x和y轴的刻度线数。


参数:lab.z
the same as lab, but for z axis.
一样lab,但Z轴。


参数:type
character indicating the type of plot: "p" for points, "l" for lines, "h" for vertical lines to x-y-plane, etc.
字符,指示类型的图:“P”点,“L”线“H”xy平面的垂直线,等等。


参数:highlight.3d
points will be drawn in different colors related to y coordinates (only if type = "p" or type = "h", else color will be used).<br> On some devices not all colors can be displayed. In this case try the postscript device or use highlight.3d = FALSE.
点会得出不同的颜色与y坐标(只有type = "p"或type = "h",其他color将使用)。<BR>在某些设备上,并非所有的颜色可以显示。在这种情况下,尝试使用PostScript设备,或使用highlight.3d = FALSE。


参数:mar
A numerical vector of the form c(bottom, left, top, right) which gives the lines of margin to be specified on the four sides of the plot.
一个数值向量的形式为c(下,左,上,右),让该行的保证金指定的四边的图。


参数:col.axis, col.grid, col.lab
the color to be used for axis / grid / axis labels.
可用于轴/网格/轴标签的颜色。


参数:cex.symbols, cex.axis, cex.lab
the magnification to be used for point symbols, axis annotation, labels relative to the current.
要用于点符号,轴标注,标签相对于当前的倍率。


参数:font.axis, font.lab
the font to be used for axis annotation / labels.
可用于轴标注/标签的字体。


参数:lty.axis, lty.grid
the line type to be used for axis / grid.
要用于轴/网格线类型。


参数:lty.hide
line style used to plot "non-visible" edges (defaults of the lty.axis style)
线条样式以用于图“不可见”的边缘(lty.axis风格的默认值)


参数:lty.hplot
the line type to be used for vertical segments with type = "h".
要使用的线路类型的垂直节段与type = "h"。


参数:log
Not yet implemented!  A character string which contains "x" (if the x axis is to be logarithmic), "y", "z", "xy", "xz", "yz", "xyz".
尚未实现的!一个字符的字符串,其中包含的“x”(如果x轴是对数的),的“y”,“z”的,“xy”的,“XZ”,“YZ”,“xyz”的。


参数:...
more graphical parameters can be given as arguments, pch = 16 or pch = 20 may be nice.
更图形化的参数可以作为参数,pch = 16或pch = 20可能是不错的。


值----------Value----------

<table summary="R valueblock"> <tr valign="top"><td>xyz.convert</td> <td> function which converts coordinates from 3D (x, y, z) to 2D-projection (x, y) of scatterplot3d. Useful to plot objects into existing plot.</td></tr> <tr valign="top"><td>points3d</td> <td> function which draws points or lines into the existing plot.</td></tr> <tr valign="top"><td>plane3d</td> <td> function which draws a plane into the existing plot: plane3d(Intercept, x.coef = NULL, y.coef = NULL, lty =       "dashed", lty.box = NULL, ...).  Instead of Intercept a vector containing 3 elements or an (g)lm object can be specified. The argument lty.box allows to set a different line style for the  intersecting lines in the box's walls.</td></tr> <tr valign="top"><td>box3d</td> <td> function which "refreshes" the box surrounding the plot.</td></tr> </table>
<table summary="R valueblock"> <tr valign="top"> <TD> xyz.convert</ TD> <TD>功能,从三维坐标(X,Y,Z)转换成二维投影(的x,y)scatterplot3d。绘制对象到现有的图。</ TD> </ TR> <tr valign="top"> <TD>points3d</ TD> <TD>功能,绘制点或线到现有的图。 </ TD> </ TR> <tr valign="top"> <TD>plane3d </ TD> <TD>函数绘制一个平面到现有的图:plane3d(Intercept, x.coef = NULL, y.coef = NULL, lty =       "dashed", lty.box = NULL, ...)。而不是Intercept一个向量,包含3个元素或(克)流明对象可以被指定。参数lty.box允许设置不同的线条样式框的墙壁相交的线。</ TD> </ TR> <tr valign="top"> <TD>box3d</ TD功能> <TD>功能的“刷新”框周围的图。</ TD> </ TR> </ TABLE>


注意----------Note----------

Some graphical parameters should only be set as arguments in scatterplot3d but not in a previous par() call.  One of these is mar, which is also non-standard in another way: Users who want to extend an existing scatterplot3d graphic with another function than points3d, plane3d or box3d, should consider to set par(mar = c(b, l, t, r)) to the value of mar used in scatterplot3d, which defaults to c(5, 3, 4, 3) + 0.1.
一些图形的参数应该被设置为scatterplot3d,但不是在以前的par()调用的参数。其中之一是mar,这也是非标以另一种方式:用户要扩展现有的scatterplot3d图形与另一个功能比points3d,plane3d或 box3d,应考虑设置par(mar = c(b, l, t, r))的价值marscatterplot3d,默认为c(5, 3, 4, 3) + 0.1的。

Other par arguments may be split into several arguments in scatterplot3d, e.g., for specifying the line type.  And finally some of par arguments do not apply here, e.g., many of those for axis calculation.  So we recommend to try the specification of graphical parameters at first as arguments in scatterplot3d and only if needed as arguments in previous par() call.
其他par参数可以分割成几个参数scatterplot3d,例如,指定行类型。终于有了一些par争论,在这里不适用,例如,许多轴计算。因此,我们建议尝试在第一个规范的图形参数作为参数scatterplot3d,如果需要的话,在以前的par()调用作为参数。


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



Uwe Ligges <a href="mailto:ligges@statistik.tu-dortmund.de">ligges@statistik.tu-dortmund.de</a>;
<a href="http://www.statistik.tu-dortmund.de/~ligges">http://www.statistik.tu-dortmund.de/~ligges</a>.




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

Ligges, U., and Maechler, M. (2003):  Scatterplot3d &ndash; an R Package for Visualizing Multivariate Data.  Journal of Statistical Software 8(11), 1&ndash;20.  http://www.jstatsoft.org/

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

persp, plot, par.
persp,plot,par。


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


  ## On some devices not all colors can be displayed.[#在某些设备上,并非所有的颜色可以显示出来。]
  ## Try the postscript device or use highlight.3d = FALSE.[#用PostScript设备或使用highlight.3d = FALSE。]

  ## example 1[#示例1]
  z <- seq(-10, 10, 0.01)
  x <- cos(z)
  y <- sin(z)
  scatterplot3d(x, y, z, highlight.3d=TRUE, col.axis="blue",
      col.grid="lightblue", main="scatterplot3d - 1", pch=20)

  ## example 2[#示例2]
  temp <- seq(-pi, 0, length = 50)
  x <- c(rep(1, 50) %*% t(cos(temp)))
  y <- c(cos(temp) %*% t(sin(temp)))
  z <- c(sin(temp) %*% t(sin(temp)))
  scatterplot3d(x, y, z, highlight.3d=TRUE,
      col.axis="blue", col.grid="lightblue",
      main="scatterplot3d - 2", pch=20)

  ## example 3[#示例3]
  temp <- seq(-pi, 0, length = 50)
  x <- c(rep(1, 50) %*% t(cos(temp)))
  y <- c(cos(temp) %*% t(sin(temp)))
  z <- 10 * c(sin(temp) %*% t(sin(temp)))
  color <- rep("green", length(x))
  temp <- seq(-10, 10, 0.01)
  x <- c(x, cos(temp))
  y <- c(y, sin(temp))
  z <- c(z, temp)
  color <- c(color, rep("red", length(temp)))
  scatterplot3d(x, y, z, color, pch=20, zlim=c(-2, 10),
      main="scatterplot3d - 3")

  ## example 4[#示例4]
  my.mat <- matrix(runif(25), nrow=5)
  dimnames(my.mat) <- list(LETTERS[1:5], letters[11:15])
  my.mat # the matrix we want to plot ...[我们要绘制的矩阵...]

  s3d.dat <- data.frame(cols=as.vector(col(my.mat)),
      rows=as.vector(row(my.mat)),
      value=as.vector(my.mat))
  scatterplot3d(s3d.dat, type="h", lwd=5, pch=" ",
      x.ticklabs=colnames(my.mat), y.ticklabs=rownames(my.mat),
      color=grey(25:1/40), main="scatterplot3d - 4")

  ## example 5[#示例5]
  data(trees)
  s3d <- scatterplot3d(trees, type="h", highlight.3d=TRUE,
      angle=55, scale.y=0.7, pch=16, main="scatterplot3d - 5")
  # Now adding some points to the "scatterplot3d"[现在加入一些点“scatterplot3d”]
  s3d$points3d(seq(10,20,2), seq(85,60,-5), seq(60,10,-10),
      col="blue", type="h", pch=16)
  # Now adding a regression plane to the "scatterplot3d"[现在加入的回归平面“scatterplot3d”的]
  attach(trees)
  my.lm <- lm(Volume ~ Girth + Height)
  s3d$plane3d(my.lm, lty.box = "solid")
  
  ## example 6; by Martin Maechler[例6,由马丁·Maechler]
  cubedraw <- function(res3d, min = 0, max = 255, cex = 2, text. = FALSE)
  {
    ## Purpose: Draw nice cube with corners[#用途:绘制漂亮的立方体的角]
    cube01 &lt;- rbind(c(0,0,1), 0, c(1,0,0), c(1,1,0), 1, c(0,1,1), # &lt; 6 outer[<6外]
                    c(1,0,1), c(0,1,0)) # &lt;- "inner": fore- &amp; back-ground[ - “内”:前背景]
    cub <- min + (max-min)* cube01
    ## visibile corners + lines:[#visibile角落+线:]
    res3d$points3d(cub[c(1:6,1,7,3,7,5) ,], cex = cex, type = 'b', lty = 1)
    ## hidden corner + lines[#隐蔽的角落+线]
    res3d$points3d(cub[c(2,8,4,8,6),     ], cex = cex, type = 'b', lty = 3)
    if(text.)## debug[#调试]
        text(res3d$xyz.convert(cub), labels=1:nrow(cub), col='tomato', cex=2)
  }
  ## 6 a) The named colors in R, i.e. colors()[#6)在R命名的颜色,即颜色()]
  cc <- colors()
  crgb <- t(col2rgb(cc))
  par(xpd = TRUE)
  rr <- scatterplot3d(crgb, color = cc, box = FALSE, angle = 24,
      xlim = c(-50, 300), ylim = c(-50, 300), zlim = c(-50, 300))
  cubedraw(rr)
  ## 6 b) The rainbow colors from rainbow(201)[#6 B)的彩虹色彩虹(201)]
  rbc <- rainbow(201)
  Rrb <- t(col2rgb(rbc))
  rR <- scatterplot3d(Rrb, color = rbc, box = FALSE, angle = 24,
      xlim = c(-50, 300), ylim = c(-50, 300), zlim = c(-50, 300))
  cubedraw(rR)
  rR$points3d(Rrb, col = rbc, pch = 16)

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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-11-29 20:38 , Processed in 0.025498 second(s), 15 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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