grid.function(grid)
grid.function()所属R语言包:grid
Draw a curve representing a function
代表一个函数绘制曲线
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Draw a curve representing a function.
代表一个函数绘制曲线。
用法----------Usage----------
grid.function(...)
functionGrob(f, n = 101, range = "x", units = "native",
name = NULL, gp=gpar(), vp = NULL)
grid.abline(intercept, slope, ...)
参数----------Arguments----------
参数:f
A function that must take a single argument and return a list with two numeric components named x and y.
函数必须采取一个参数并返回一个列表,两个数字组成名为x和y。
参数:n
The number values that will be generated as input to the function f.
将作为输入功能f产生的数量值。
参数:range
Either "x", "y", or a numeric vector. See the "Details" section.
要么"x","y",或数字向量。看到“详细资料”一节。
参数:units
A string indicating the units to use for the x and y values generated by the function.
一个字符串,指示要使用的单位为x和y函数生成的值。
参数:intercept
Numeric.
数字。
参数:slope
Numeric.
数字。
参数:...
Arguments passed to grid.function()
参数传递grid.function()
参数:name
A character identifier.
字符识别。
参数:gp
An object of class gpar, typically the output from a call to the function gpar. This is basically a list of graphical parameter settings.
一个类的对象gpar,通常从调用输出函数gpar。这基本上是一个图形参数设置列表。
参数:vp
A Grid viewport object (or NULL).
一个网格视口对象(或NULL)。
Details
详情----------Details----------
n values are generated and passed to the function f and a series of lines are drawn through the resulting x and y values.
n值产生传递f和制订了一系列行是通过由此产生的x和y值的功能。
The generation of the n values depends on the value of range. In the default case, dim is "x", which means that a set of x values are generated covering the range of the current viewport scale in the x-dimension. If dim is "y" then values are generated from the current y-scale instead. If range is a numeric vector, then values are generated from that range.
取决于一代n值上range值。在默认情况下,dim是"x",这意味着一套x值生成的覆盖范围在X维的当前视口中的规模。如果dim是"y"然后从目前的规模,而不是Y-生成值。如果range是一个数值向量,然后值,范围从产生。
grid.abline() provides a simple front-end for a straight line parameterized by intercept and slope.
grid.abline()直线intercept和slope参数提供了一个简单的前端。
值----------Value----------
A functiongrob grob.
一个functiongrob GROB。
作者(S)----------Author(s)----------
Paul Murrell
参见----------See Also----------
Grid, viewport
电网,viewport
举例----------Examples----------
# abline[abline]
# NOTE: in ROOT viewport on screen, (0, 0) at top-left[注:根视口在屏幕上,(0,0)在左上角]
# and "native" is pixels![和“本土”是像素!]
grid.function(function(x) list(x=x, y=0 + 1*x))
# a more "normal" viewport with default normalized "native" coords[一个更“正常”视口默认正常化“本土”的坐标]
grid.newpage()
pushViewport(viewport())
grid.function(function(x) list(x=x, y=0 + 1*x))
# slightly simpler[稍微简单]
grid.newpage()
pushViewport(viewport())
grid.abline()
# sine curve[正弦曲线]
grid.newpage()
pushViewport(viewport(xscale=c(0, 2*pi), yscale=c(-1, 1)))
grid.function(function(x) list(x=x, y=sin(x)))
# constrained sine curve[约束正弦曲线]
grid.newpage()
pushViewport(viewport(xscale=c(0, 2*pi), yscale=c(-1, 1)))
grid.function(function(x) list(x=x, y=sin(x)),
range=0:1)
# inverse sine curve[逆正弦曲线]
grid.newpage()
pushViewport(viewport(xscale=c(-1, 1), yscale=c(0, 2*pi)))
grid.function(function(y) list(x=sin(y), y=y),
range="y")
# parametric function[参数功能]
grid.newpage()
pushViewport(viewport(xscale=c(-1, 1), yscale=c(-1, 1)))
grid.function(function(t) list(x=cos(t), y=sin(t)),
range=c(0, 9*pi/5))
# physical abline[物理abline]
grid.newpage()
grid.function(function(x) list(x=x, y=0 + 1*x),
units="in")
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|