panel.xyplot(lattice)
panel.xyplot()所属R语言包:lattice
Default Panel Function for xyplot
为xyplot默认面板功能
译者:生物统计家园网 机器人LoveR
描述----------Description----------
This is the default panel function for xyplot. Also see panel.superpose. The default panel functions for splom and qq are essentially the same function.
这是xyplot的默认面板功能。还可以看到panel.superpose。 splom和qq基本上都是相同的功能的默认面板的功能。
用法----------Usage----------
panel.xyplot(x, y, type = "p",
groups = NULL,
pch, col, col.line, col.symbol,
font, fontfamily, fontface,
lty, cex, fill, lwd,
horizontal = FALSE, ...,
grid = FALSE, abline = NULL,
jitter.x = FALSE, jitter.y = FALSE,
factor = 0.5, amount = NULL,
identifier = "xyplot")
panel.splom(..., identifier = "splom")
panel.qq(..., identifier = "qq")
参数----------Arguments----------
参数:x,y
variables to be plotted in the scatterplot
在绘制散点图变量
参数:type
character vector consisting of one or more of the following: "p", "l", "h", "b", "o", "s", "S", "r", "a", "g", "smooth", and "spline". If type has more than one element, an attempt is made to combine the effect of each of the components. The behaviour if any of the first six are included in type is similar to the effect of type in plot (type "b" is actually the same as "o"). "r" adds a linear regression line (same as panel.lmline, except for default graphical parameters). "smooth" adds a loess fit (same as panel.loess). "spline" adds a cubic smoothing spline fit (same as panel.spline). "g" adds a reference grid using panel.grid in the background (but using the grid argument is now the preferred way to do so). "a" has the effect of calling panel.average, which can be useful for creating interaction plots. The effect of several of these specifications depend on the value of horizontal. Type "s" (and "S") sorts the values along one of the axes (depending on horizontal); this is unlike the behavior in plot. For the latter behavior, use type = "s" with panel = panel.points. See example(xyplot) and demo(lattice) for examples.
特征向量组成:一个或多个以下"p","l","h","b","o","s",<X >,"S","r","a","g","smooth"。如果"spline"有一个以上的元素,试图将结合每个组件的作用。如果包括在type上半年的行为是类似的效果typetype(plot"b"的同类型 )。 "o"增加了线性回归线("r"相同,默认的图形参数除外)。 panel.lmline增加了黄土适合("smooth"相同)。 panel.loess增加了三次平滑样条拟合("spline"相同)。 panel.spline增加了一个参考网格使用"g"的背景(但使用panel.grid参数是现在的首选方式,这样做)。 grid调用"a",它可以用于创建交互图的效果。这些规格的影响取决于上panel.average值。键入horizontal("s")各种沿轴的值(取决于"S");这是不像horizontal行为。对于后者的行为,使用plottype = "s"。为例子,请参阅panel = panel.points和example(xyplot)。
参数:groups
an optional grouping variable. If present, panel.superpose will be used instead to display each subgroup
一个可选的分组变量。如果存在,panel.superpose将用来代替显示每个分组
参数:col, col.line, col.symbol
default colours are obtained from plot.symbol and plot.line using trellis.par.get.
默认的颜色是从plot.symbol和plot.line用trellis.par.get。
参数:font, fontface, fontfamily
font used when pch is a character
字体使用时pch是一个字符
参数:pch, lty, cex, lwd, fill
other graphical parameters. fill serves the purpose of bg in points for certain values of pch
其他图形参数。 fill服务bgpointspch的某些值的目的,
参数:horizontal
A logical flag controlling the orientation for certain type's, e.g., "h", "s", ans "S".
控制逻辑标志的方向,一定type,如"h","s",ANS"S"。
参数:...
Extra arguments, if any, for panel.xyplot. In most cases panel.xyplot ignores these. For types "r" and "smooth", these are passed on to panel.lmline and panel.loess respectively.
额外的参数,如果有的话,panel.xyplot。在大多数情况下panel.xyplot忽略这些。 “R”和“平稳”的类型,这些都传递给panel.lmline和panel.loess分别。
参数:grid
A logical flag, character string, or list specifying whether and how a background grid should be drawn. This provides the same functionality as type="g", but is the preferred alternative as the effect type="g" is conceptually different from that of other type values (which are all data-dependent). Using the grid argument also allows more flexibility. Most generally, grid can be a list of arguments to be supplied to panel.grid, which is called with those arguments. Three shortcuts are available:
是否和如何指定背景网格应制订一个逻辑标志,字符串或列表。这提供了相同的功能,为type="g"但作为首选替代的作用type="g"是从其他type值(这是所有的数据依赖)的概念不同。使用grid参数,还可以让更多的灵活性。最普遍,grid可以提供panel.grid,这是与这些参数称为参数列表。三个快捷方式可供选择:
TRUE: roughly equivalent to list(h = -1, v = -1)
TRUE:list(h = -1, v = -1)大致相当于
"h": roughly equivalent to list(h = -1, v = 0)
"h":list(h = -1, v = 0)大致相当于
"v": roughly equivalent to list(h = 0, v = -1) No grid is drawn if grid = FALSE.
"v":大致相当于list(h = 0, v = -1)无网格绘制如果grid = FALSE。
参数:abline
A numeric vector or list, specifying arguments arguments for panel.abline, which is called with those arguments. If specified as a (possibly named) numeric vector, abline is coerced to a list. This allows arguments of the form abline = c(0, 1), which adds the diagonal line, or abline = c(h = 0, v = 0), which adds the x- and y-axes to the plot. Use the list form for finer control; e.g., abline = list(h = 0, v = 0, col = "grey"). For more flexibility, use panel.abline directly.
panel.abline,这是与这些参数称为指定一个数值向量或列表,论点论据。如果指定为数字向量(可能命名),abline被强制到一个列表。这使得参数形式abline = c(0, 1),这增加了对角线,或abline = c(h = 0, v = 0),这增加了x和y轴的图。为更好地控制使用列表的形式,例如,abline = list(h = 0, v = 0, col = "grey")。更多的灵活性,可使用panel.abline直接。
参数:jitter.x, jitter.y
logical, whether the data should be jittered before being plotted.
逻辑,数据是否应被绘制之前抖动。
参数:factor, amount
controls amount of jittering.
控制抖动金额。
参数:identifier
A character string that is prepended to the names of grobs that are created by this panel function.
一个字符串,前面的名称,由本面板功能创建的grobs。
Details
详情----------Details----------
Creates scatterplot of x and y, with various modifications possible via the type argument. panel.qq draws a 45 degree line before calling panel.xyplot.
创建散点图,通过类型参数可能与各种修改x和y。 panel.qq绘制之前调用panel.xyplot45度线。
Note that most of the arguments controlling the display can be supplied directly to the high-level (e.g. xyplot) call.
请注意,大部分控制显示的参数,可以直接提供给高级别(例如xyplot)调用。
作者(S)----------Author(s)----------
Deepayan Sarkar <a href="mailtoeepayan.Sarkar@R-project.org">Deepayan.Sarkar@R-project.org</a>
参见----------See Also----------
panel.superpose, xyplot, splom
panel.superpose,xyplot,splom
举例----------Examples----------
types.plain <- c("p", "l", "o", "r", "g", "s", "S", "h", "a", "smooth")
types.horiz <- c("s", "S", "h", "a", "smooth")
horiz <- rep(c(FALSE, TRUE), c(length(types.plain), length(types.horiz)))
types <- c(types.plain, types.horiz)
x <- sample(seq(-10, 10, length.out = 15), 30, TRUE)
y <- x + 0.25 * (x + 1)^2 + rnorm(length(x), sd = 5)
xyplot(y ~ x | gl(1, length(types)),
xlab = "type",
ylab = list(c("horizontal=TRUE", "horizontal=FALSE"), y = c(1/6, 4/6)),
as.table = TRUE, layout = c(5, 3),
between = list(y = c(0, 1)),
strip = function(...) {
panel.fill(trellis.par.get("strip.background")$col[1])
type <- types[panel.number()]
grid::grid.text(label = sprintf('"%s"', type),
x = 0.5, y = 0.5)
grid::grid.rect()
},
scales = list(alternating = c(0, 2), tck = c(0, 0.7), draw = FALSE),
par.settings =
list(layout.widths = list(strip.left = c(1, 0, 0, 0, 0))),
panel = function(...) {
type <- types[panel.number()]
horizontal <- horiz[panel.number()]
panel.xyplot(...,
type = type,
horizontal = horizontal)
})[rep(1, length(types))]
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|