plot-methods(distr)
plot-methods()所属R语言包:distr
Methods for Function plot in Package ‘distr’
方法函数图在包装“颇”
译者:生物统计家园网 机器人LoveR
描述----------Description----------
plot-methods
图方法
用法----------Usage----------
## S4 method for signature 'AbscontDistribution,missing'
plot(x, width = 10, height = 5.5,
withSweave = getdistrOption("withSweave"), xlim = NULL, ylim = NULL, ngrid = 1000,
verticals = TRUE, do.points = TRUE, main = FALSE, inner = TRUE,
sub = FALSE, bmar = par("mar")[1], tmar = par("mar")[3], ...,
cex.main = par("cex.main"), cex.inner = 1.2, cex.sub = par("cex.sub"),
col.points = par("col"), col.vert = par("col"), col.main = par("col.main"),
col.inner = par("col.main"), col.sub = par("col.sub"), cex.points = 2.0,
pch.u = 21, pch.a = 16, mfColRow = TRUE,
to.draw.arg = NULL)
## S4 method for signature 'DiscreteDistribution,missing'
plot(x, width = 10, height = 5.5,
withSweave = getdistrOption("withSweave"), xlim = NULL, ylim = NULL, verticals = TRUE,
do.points = TRUE, main = FALSE, inner = TRUE, sub = FALSE,
bmar = par("mar")[1], tmar = par("mar")[3], ...,
cex.main = par("cex.main"), cex.inner = 1.2, cex.sub = par("cex.sub"),
col.points = par("col"), col.hor = par("col"), col.vert = par("col"),
col.main = par("col.main"), col.inner = par("col.main"),
col.sub = par("col.sub"), cex.points = 2.0, pch.u = 21, pch.a = 16, mfColRow = TRUE,
to.draw.arg = NULL)
## S4 method for signature 'AffLinUnivarLebDecDistribution,missing'
plot(x, width = 10,
height = 5.5, withSweave = getdistrOption("withSweave"), xlim = NULL, ylim = NULL, ngrid = 1000,
verticals = TRUE, do.points = TRUE, main = FALSE, inner = TRUE, sub = FALSE,
bmar = par("mar")[1], tmar = par("mar")[3], ..., cex.main = par("cex.main"),
cex.inner = 1.2, cex.sub = par("cex.sub"), col.points = par("col"),
col.hor = par("col"), col.vert = par("col"), col.main = par("col.main"),
col.inner = par("col.main"), col.sub = par("col.sub"), cex.points = 2.0,
pch.u = 21, pch.a = 16, mfColRow = TRUE,
to.draw.arg = NULL)
## S4 method for signature 'UnivarLebDecDistribution,missing'
plot(x, width = 10,
height = 14.5, withSweave = getdistrOption("withSweave"), xlim = NULL, ylim = NULL, ngrid = 1000,
verticals = TRUE, do.points = TRUE, main = FALSE, inner = TRUE, sub = FALSE,
bmar = par("mar")[1], tmar = par("mar")[3], ..., cex.main = par("cex.main"),
cex.inner = 0.9, cex.sub = par("cex.sub"), col.points = par("col"),
col.hor = par("col"), col.vert = par("col"), col.main = par("col.main"),
col.inner = par("col.main"), col.sub = par("col.sub"), cex.points = 2.0,
pch.u = 21, pch.a = 16, mfColRow = TRUE,
to.draw.arg = NULL)
## S4 method for signature 'DistrList,missing'
plot(x, y, ...)
## S4 method for signature 'CompoundDistribution,missing'
plot(x, y, ...)
参数----------Arguments----------
参数:x
object of class "AffLinUnivarLebDecDistribution" or class "UnivarLebDecDistribution" or class "AbscontDistribution" or class "DiscreteDistribution" or class "DistrList": (list of) distribution(s) to be plotted
对象的类"AffLinUnivarLebDecDistribution"或类"UnivarLebDecDistribution"类"AbscontDistribution"或类"DiscreteDistribution"类"DistrList":(列表)分布(S)绘制
参数:y
missing
失去
参数:xlim
the x limits (x1, x2) of the plot. Note that x1 > x2 is allowed and leads to a "reversed axis". As in plot.default.
在x限制(X1,X2)的图。请注意,x1 > x2是允许的,导致的“反转轴”。至于在plot.default。
参数:ylim
the y limits of the plot. Either as in plot.default (i.e. a vector of length 2) or a vector of length 4, where the first two elements are the values for ylim in panel "d", and the last two elements are the values for ylim resp. xlim in panels "p", and "q".
在y限制的图。或是作为plot.default(即一个向量的长度为2)或长度为4,其中前两个元素ylim面板中的“d”的值的矢量,和最后两个元素是ylimRESP的值。 xlim面板中的“P”和“Q”。
参数:width
width (in inches) of the graphics device opened
打开宽度(以英寸为单位)的图形设备
参数:height
height (in inches) of the graphics device opened
打开的图形设备的高度(英寸)
参数:withSweave
logical: if TRUE (for working with Sweave) no extra device is opened and height/width are not set
逻辑:如果TRUE(工作Sweave)没有额外的设备被打开,没有设置高度/宽度
参数:ngrid
integer: number of grid points used for plots of absolutely continuous distributions
用于绝对连续分布图的网格点整数数
参数:main
logical: is a main title to be used? or <br> just as argument main in plot.default.
符合逻辑的:是一个主标题使用? ,或<br>只是作为参数main中plot.default。
参数:inner
logical: do panels for density/probability function - cdf - quantile function have their own titles? or <br> list which is filled to length 3 (resp. 8 for class UnivarLebDecDistribution) if necessary (possibly using recycling rules): titles for density/probability function - cdf - quantile function (each of the same form as argument main in plot.default)
逻辑:做板密度/概率函数 - CDF - 分位数函数有自己的游戏吗?或<br>列表填充长度为3类(或8UnivarLebDecDistribution)如果有必要(可能使用回收规则):密度/概率函数的标题 - CDF - 分位数函数(每个具有相同的形式,参数mainplot.default)
参数:sub
logical: is a sub-title to be used? or <br> just as argument sub in plot.default.
符合逻辑的:是要使用一个子标题吗? ,或<br>只是作为参数sub中plot.default。
参数:tmar
top margin – useful for non-standard main title sizes
- 有用的页边距为标准的主标题大小非
参数:bmar
bottom margin – useful for non-standard sub title sizes
底部边缘 - 可用于非标字幕大小
参数:verticals
logical: if TRUE, draw vertical lines at steps; as in plot.stepfun
逻辑:如果TRUE,画垂直线的步骤,如plot.stepfun
参数:do.points
logical: if TRUE, draw also draw points at the (xlim restricted) knot locations; as in plot.stepfun
逻辑:如果TRUE,画也画点(xlim限制)结位置在plot.stepfun
参数:cex.points
numeric; character expansion factor; as in plot.stepfun
数字字符膨胀系数,如plot.stepfun
参数:col.points
character or integer code; color of points; as in plot.stepfun
字符或整数代码;颜色的点,如plot.stepfun
参数:col.hor
character or integer code; color of horizontal lines; as in plot.stepfun
字符或整数代码的水平线条的颜色,如plot.stepfun
参数:col.vert
character or integer code; color of vertical lines; as in plot.stepfun
字符或整数代码的垂直线条的颜色,如plot.stepfun
参数:cex.main
magnification to be used for main titles relative to the current setting of cex; as in par
用于放大的相对的当前设置cex,par的主标题
参数:cex.inner
magnification to be used for inner titles relative to the current setting of cex; as in par
放大倍率的相对的当前设置cex,par的内标题
参数:cex.sub
magnification to be used for sub titles relative to the current setting of cex; as in par
放大倍率的相对的当前设置cex,par的副标题
参数:col.main
character or integer code; color for the main title
字符或整数代码;主标题的颜色
参数:col.inner
character or integer code; color for the inner title
字符或整数代码;内标题的颜色
参数:col.sub
character or integer code; color for the sub title
字符或整数代码;子标题的颜色
参数:pch.u
character or integer code; plotting characters or symbols for unattained value; see points
字符或整数代码绘制前所未有的值的字符或符号; points
参数:pch.a
character or integer code; plotting characters or symbols for attained value; see points
字符或整数代码,策划为达到值的字符或符号;看到points
参数:mfColRow
shall default partition in panels be used — defaults to TRUE
应面板中使用默认的分区 - 默认TRUE
参数:to.draw.arg
Either NULL (default; everything is plotted) or a vector of either integers (the indices of the subplots to be drawn) or characters — the names of the subplots to be drawn: in case of an object x of class "DiscreteDistribution" or "AbscontDistribution" c("d","p","q") for density, c.d.f. and quantile function; in case of x a proper "UnivarLebDecDistribution" (with pos. weights for both discrete and abs. continuous part) names are c("p","q","d.c","p.c","q.c","d.d","p.d","q.d")) for c.d.f. and quantile function of the composed distribution and the respective three panels for the absolutely continuous and the discrete part, respectively;
无论是NULL(默认情况下,一切都绘制)或向量的整数(要绘制的次要图的指标)或字符 - 要绘制的次要图的名字:一个对象的情况下,<X >类x或"DiscreteDistribution""AbscontDistribution"密度,CDF和分位数函数的情况下,c("d","p","q")适当的x(POS。离散和ABS。连续部分的权重)的名称是"UnivarLebDecDistribution")CDF和分位数函数的组成分布和绝对连续和离散部分,分别在各自的三面围板;
参数:...
addtional arguments for plot — see plot, plot.default, plot.stepfun
addtional参数plot - 看plot,plot.default,plot.stepfun
Details
详细信息----------Details----------
plotsignature(x = "AffLinUnivarLebDecDistribution", y = "missing"): plots cumulative distribution function and the quantile function
图signature(x = "AffLinUnivarLebDecDistribution", y = "missing"):图累积分布函数和分位数函数
plotsignature(x = "UnivarLebDecDistribution", y = "missing"): plots a set of eight plots: in the first row, it plots the cumulative distribution function and the quantile function; in the second row the absolutely continuous part (with density, cdf and quantile fct.), and in the last row the discrete part (with prob.fct., cdf and quantile fct.).
图signature(x = "UnivarLebDecDistribution", y = "missing"):在第二行中的绝对连续的部分(与密度,民防部队和分位数FCT),并绘制一组八幅:在第一行中,图的累积分布函数和分位数的功能;在最后一排的离散部分(prob.fct。,民防部队和分位数FCT)。
plotsignature(x = "CompoundDistribution", y = "missing"): coerces x to "UnivarLebDecDistribution" and uses the corresponding method.
图signature(x = "CompoundDistribution", y = "missing"):胁迫x"UnivarLebDecDistribution",并使用相应的方法。
plotsignature(x = "AbscontDistribution", y = "missing"): plots density, cumulative distribution function and the quantile function
图signature(x = "AbscontDistribution", y = "missing"):图密度,累积分布函数和分位数函数
plotsignature(x = "DiscreteDistribution", y = "missing"): plots probability function, cumulative distribution function and the quantile function
图signature(x = "DiscreteDistribution", y = "missing"):图概率函数,累积分布函数和分位数函数
plotsignature(x = "DistrList", y = "missing"): plots a list of distributions Any parameters of plot.default may be passed on to this particular plot method.
图signature(x = "DistrList", y = "missing"):绘制分布列表的任何参数,plot.default可能会传递到这个特殊的plot方法。
For main-, inner, and subtitles given as arguments main, inner, and sub, top and bottom margins are enlarged to 5 resp. 6 by default but may also be specified by tmar / bmar arguments. If main / inner / sub are logical then if the respective argument is FALSE nothing is done/plotted, but if it is TRUE, we use a default main title taking up the calling argument x in case of main, default inner titles taking up the class and (named) parameter slots of argument x in case of inner, and a "generated on <data>"-tag in case of sub. Of course, if main / inner / sub are character, this is used for the title; in case of inner it is then checked whether it has length 3. In all title arguments, the following patterns are substituted:
对于主内,并作为参数的字幕main,inner和sub,顶部和底部边缘被放大至5 RESP账户。默认情况下,但也可以指定tmar/bmar参数。如果main/inner/sub是逻辑,如果相应的参数是FALSE没有做/绘制,但如果是TRUE,我们使用一个默认的主标题的调用参数xmain,默认的内部标题的类(命名的)参数槽的参数的情况下,xinner的情况下, ,和“的<data>上产生”标签箱子sub。当然,如果main/inner/sub是character,这是作为标题;的情况下,inner,然后检查是否有长度为3。在所有标题参数,下面的模式所取代:
"%C"class of argument x
"%C"类的说法x
"%P"parameters of x in form of a comma-separated list of <value>'s coerced to character
是"%P"参数x的一个逗号分隔的列表,其中value的形式强制转换为字符
"%Q"parameters of x in form of a comma-separated list of <value>'s coerced to character and in parenthesis — unless empty; then ""
"%Q"参数x的一个逗号分隔的列表,其中value的形式强制转换为字符和括号中的 - 除非是空的,然后“
"%N"parameters of x in form of a comma-separated list <name> = <value> coerced to character
"%N"参数x的一个逗号分隔的列表形式在<名称> = <值>强制转换为字符
"%A"deparsed argument x
"%A"的deparsed参数x
"%D"time/date-string when the plot was generated
"%D"时间/日期字符串时的图生成
If not explicitly set, col.points, col.vert, col.hor, col.main, col.inner, col.sub are set to col if this arg is given and else to par("col") resp. for the titles par("col.main"), par("col.main"), par("col.sub").
如果没有明确设定,col.points,col.vert,col.hor,col.main,col.inner,col.sub设置为col,如果这阿根廷和其他par("col")RESP。为标题par("col.main"),par("col.main"),par("col.sub")。
If not explicitly set, pch.a, pch.u are set to pch if this arg is given and else to 16, 21, respectively.
如果没有明确设定,pch.a,pch.u设置为pch如果这ARG和其他至16,21,分别。
If not explicitly set, cex is set to 1. If not explicitly set, cex.points is set to $2.0 cex$ (if cex is given) and to 2.0 else.
如果没有明确设定,cex设置为1。如果没有明确设定,cex.points设置为$ 2.0cex$(cex如果)和2.0其他。
参见----------See Also----------
plot,plot.default,
plot,plot.default,
实例----------Examples----------
plot(Binom(size = 4, prob = 0.3))
plot(Binom(size = 4, prob = 0.3), do.points = FALSE)
plot(Binom(size = 4, prob = 0.3), verticals = FALSE)
plot(Binom(size = 4, prob = 0.3), main = TRUE)
plot(Binom(size = 4, prob = 0.3), main = FALSE)
plot(Binom(size = 4, prob = 0.3), cex.points = 1.2, pch = 20)
B <- Binom(size = 4, prob = 0.3)
plot(B, col = "red", col.points = "green", main = TRUE, col.main = "blue",
col.sub = "orange", sub = TRUE, cex.sub = 0.6, col.inner = "brown")
plot(Nbinom(size = 4,prob = 0.3), cex.points = 1.2, col = "red",
col.points = "green")
plot(Nbinom(size = 4,prob = 0.3), cex.points = 1.2, pch.u = 20, pch.a = 10)
plot(Norm(), main = TRUE, cex.main = 3, tmar = 6)
plot(Norm(), inner = FALSE, main = TRUE, cex.main = 3, tmar = 6)
plot(Norm(), lwd = 3, col = "red", ngrid = 200, lty = 3, las = 2)
plot(Norm(), main = "my Distribution: %A",
inner = list(expression(paste(lambda,"-density of %C(%P)")), "CDF",
"Pseudo-inverse with param's %N"),
sub = "this plot was correctly generated on %D",
cex.inner = 0.9, cex.sub = 0.8)
plot(Cauchy())
plot(Cauchy(), xlim = c(-4,4))
plot(Chisq())
plot(Chisq(), log = "xy", ngrid = 100)
Ch <- Chisq(); setgaps(Ch); plot(Ch, do.points = FALSE)
setgaps(Ch, exactq = 3); plot(Ch, verticals = FALSE)
plot(Ch, cex = 1.2, pch.u = 20, pch.a = 10, col.points = "green",
col.vert = "red")
## some distribution with gaps[#一些分布差距]
wg <- flat.mix(UnivarMixingDistribution(Unif(0,1),Unif(4,5),
withSimplify=FALSE))
# some Lebesgue decomposed distribution [一些勒贝格分解分布]
mymix <- UnivarLebDecDistribution(acPart = wg, discretePart = Binom(4,.4),
acWeight = 0.4)
plot(mymix)
#[]
## selection of subpanels for plotting[选择的子面板的图]
N <- Norm()
par(mfrow=c(1,2))
plot(N, mfColRow = FALSE, to.draw.arg=c("d","q"))
plot(N, mfColRow = FALSE, to.draw.arg=c(2,3))
par(mfrow=c(1,1))
wg <- flat.mix(UnivarMixingDistribution(Unif(0,1),Unif(4,5),
withSimplify=FALSE))
myLC <- UnivarLebDecDistribution(discretePart=Binom(3,.3), acPart = wg,
discreteWeight=.2)
layout(matrix(c(rep(1,6),2,2,3,3,4,4,5,5,5,6,6,6),
nrow=3, byrow=TRUE))
plot(myLC,mfColRow = FALSE,
to.draw.arg=c("p","d.c","p.c","q.c", "p.d","q.d"))
P <- Pois(2)
plot(as(P,"UnivarLebDecDistribution"),mfColRow = FALSE,to.draw.arg=c("d.d"))
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|