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

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

[复制链接]
发表于 2012-2-16 20:17:38 | 显示全部楼层 |阅读模式
plot.default(graphics)
plot.default()所属R语言包:graphics

                                        The Default Scatterplot Function
                                         默认散点图功能

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

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

Draw a scatter plot with decorations such as axes and titles in the active graphics window.
绘制散点图与装饰,如轴和积极的图形窗口的标题。


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


## Default S3 method:[默认方法]
plot(x, y = NULL, type = "p",  xlim = NULL, ylim = NULL,
     log = "", main = NULL, sub = NULL, xlab = NULL, ylab = NULL,
     ann = par("ann"), axes = TRUE, frame.plot = axes,
     panel.first = NULL, panel.last = NULL, asp = NA, ...)



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

参数:x, y
the x and y arguments provide the x and y coordinates for the plot.  Any reasonable way of defining the coordinates is acceptable.  See the function xy.coords for details.  If supplied separately, they must be of the same length.
x和y参数提供X和Y坐标图。任何合理的方式是可以接受的定义的坐标。请参阅功能细节xy.coords。如果单独提供的,它们必须是相同的长度。


参数:type
1-character string giving the type of plot desired.  The following values are possible, for details, see plot: "p" for points, "l" for lines, "o" for overplotted points and lines, "b", "c") for (empty if "c") points joined by lines, "s" and "S" for stair steps and "h" for histogram-like vertical lines.  Finally, "n" does not produce any points or lines.
1个字符的字符串图所需的类型。下列值是可能的,有关详细信息,请参阅plot:"p"分"l"行"o"为overplotted点,线,"b", "c")(如果"c")点线加入,空"s"和"S"楼梯步骤和"h"直方图的垂直线。最后,"n"不产生任何点或线。


参数:xlim
the x limits (x1, x2) of the plot.  Note that x1 > x2 is allowed and leads to a "reversed axis".  The default value, NULL, indicates that the range of the finite values to be plotted should be used.
的X限制(X1,X2)的图。注意x1 > x2允许和导致“反相轴”的。默认值,NULL,表示要绘制的有限值范围内,应使用。


参数:ylim
the y limits of the plot.
图的Y限制。


参数:log
a character string which contains "x" if the x axis is to be logarithmic, "y" if the y axis is to be logarithmic and "xy" or "yx" if both axes are to be logarithmic.
一个字符串,其中包含"x"如果x轴是对数,"y"y轴是对数和"xy"或"yx"如果两个轴数。


参数:main
a main title for the plot, see also title.
为剧情的主标题,也看到title。


参数:sub
a sub title for the plot.
子标题为图。


参数:xlab
a label for the x axis, defaults to a description of x.
为x轴的标签,默认到x描述。


参数:ylab
a label for the y axis, defaults to a description of y.
为y轴的标签,默认到y描述。


参数:ann
a logical value indicating whether the default annotation (title and x and y axis labels) should appear on the plot.
一个逻辑值,指示是否应该出现的图默认的注释(标题和X和Y轴标签)。


参数:axes
a logical value indicating whether both axes should be drawn on the plot.  Use graphical parameter "xaxt" or "yaxt" to suppress just one of the axes.
一个逻辑值,指示是否应根据图绘制两个轴。使用图形参数"xaxt"或"yaxt"只是一个轴抑制。


参数:frame.plot
a logical indicating whether a box should be drawn around the plot.
逻辑指示是否应围绕图绘制一个框。


参数:panel.first
an "expression" to be evaluated after the plot axes are set up but before any plotting takes place.  This can be useful for drawing background grids or scatterplot smooths.  Note that this works by lazy evaluation: passing this argument from other plot methods may well not work since it may be evaluated too early.
表达后图轴的评估成立,但在此之前的任何图发生。这可以用于绘制背景网格或散点图平滑。请注意,此工程懒惰的评价:通过这个参数从其他plot方法可能无法正常工作,因为它可评估为时尚早。


参数:panel.last
an expression to be evaluated after plotting has taken place but before the axes, title and box are added.  See the comments about panel.first.
表达图后评估已采取的地方,但轴,标题和框前加入。见panel.first的意见。


参数:asp
the y/x aspect ratio, see plot.window.
y/x长宽比,看到plot.window。


参数:...
other graphical parameters (see par and section "Details" below).
其他图形参数(见par和部分“详细信息”下面)。


Details

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

Commonly used graphical parameters are:
常用的图形参数是:




col The colors for lines and points.  Multiple colors can be specified so that each point can be given its own color.  If there are fewer colors than points they are recycled in the standard
col线和点的颜色。可以指定多种颜色,使每个点可以给自己的颜色。如果有比少点颜色,他们回收标准




bg a vector of background colors for open plot symbols, see points.  Note: this is not the same setting
bg的背景颜色为开放式小区符号的向量,看到points。注意:这是不相同的设置




pch a vector of plotting characters or symbols:
pch矢量绘制的字符或符号:




cex a numerical vector giving the amount by which plotting characters and symbols should be scaled relative to the default.  This works as a multiple of par("cex"). NULL and NA are equivalent to 1.0.  Note that
cex一个数值向量,使绘制的字符和符号相对应扩大默认的金额。这作品作为par("cex")的倍数。 NULL和NA1.0是等价的。请注意




lty the line type, see par.
lty线路类型,请参阅par。

etc</dt> settings for main- and sub-title and axis annotation, see
等</ DT>设置主,分标题和轴的注释,请参阅




lwd the line width, see par.
lwd线条的宽度,请参阅par。


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

The New S Language. Wadsworth &amp; Brooks/Cole.
The Elements of Graphing Data. Monterey, CA: Wadsworth.


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

plot, plot.window, xy.coords.
plot,plot.window,xy.coords。


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


Speed <- cars$speed
Distance <- cars$dist
plot(Speed, Distance, panel.first = grid(8,8),
     pch = 0, cex = 1.2, col = "blue")
plot(Speed, Distance,
     panel.first = lines(stats::lowess(Speed, Distance), lty = "dashed"),
     pch = 0, cex = 1.2, col = "blue")

## Show the different plot types[#显示不同的图类型]
x <- 0:12
y <- sin(pi/5 * x)
op <- par(mfrow = c(3,3), mar = .1+ c(2,2,3,1))
for (tp in c("p","l","b",  "c","o","h",  "s","S","n")) {
   plot(y ~ x, type = tp,
        main = paste("plot(*, type = \"",tp,"\")",sep=""))
   if(tp == "S") {
      lines(x,y, type = "s", col = "red", lty = 2)
      mtext("lines(*, type = \"s\", ...)", col = "red", cex=.8)
   }
}
par(op)

##--- Log-Log Plot  with  custom axes[#--- log-log图,自定义轴]
lx <- seq(1,5, length=41)
yl <- expression(e^{-frac(1,2) * {log[10](x)}^2})
y <- exp(-.5*lx^2)
op <- par(mfrow=c(2,1), mar=par("mar")+c(0,1,0,0))
plot(10^lx, y, log="xy", type="l", col="purple",
     main="Log-Log plot", ylab=yl, xlab="x")
plot(10^lx, y, log="xy", type="o", pch='.', col="forestgreen",
     main="Log-Log plot with custom axes", ylab=yl, xlab="x",
     axes = FALSE, frame.plot = TRUE)
my.at <- 10^(1:5)
axis(1, at = my.at, labels = formatC(my.at, format="fg"))
at.y <- 10^(-5:-1)
axis(2, at = at.y, labels = formatC(at.y, format="fg"), col.axis="red")
par(op)

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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-5-6 16:53 , Processed in 0.027021 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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