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

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

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

                                        Compute Axis Tickmark Locations
                                         计算轴对勾标记点

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

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

Compute pretty tickmark locations, the same way as R does internally. This is only non-trivial when log coordinates are active. By default, gives the at values which axis(side) would use.
计算漂亮的对勾标记的位置,以同样的方式为R做内部。这仅仅是不平凡的日志坐标活跃时。默认情况下,给出了at值,其中axis(side)将使用。


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


axTicks(side, axp = NULL, usr = NULL, log = NULL, nintLog = NULL)



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

参数:side
integer in 1:4, as for axis.
在1:4的整数,作为axis。


参数:axp
numeric vector of length three, defaulting to par("xaxp") or par("yaxp") depending on the side argument (par("xaxp") if side is 1 or 3, par("yaxp") if side is 2 or 4).
向量长度的三个数字,拖欠par("xaxp")或par("yaxp")的side参数(par("xaxp")如果side是1或3,par("yaxp")如果一边是2或4)。


参数:usr
numeric vector of length two giving user coordinate limits, defaulting to the relevant portion of par("usr") (par("usr")[1:2] or par("usr")[3:4] for side in (1,3) or (2,4) respectively).
两个数字矢量的长度给用户坐标的限制,拖欠的有关部分par("usr")(par("usr")[1:2]或par("usr")[3:4]side(1,3)或(2,4 ))。


参数:log
logical indicating if log coordinates are active; defaults to par("xlog") or par("ylog") depending on side.
逻辑表示如果日志坐标是积极的;默认par("xlog")或par("ylog")视side。


参数:nintLog
(only used when log is true): approximate (lower bound for the) number of tick intervals; defaults to par("lab")[j] where j is 1 or 2 depending on side.  Set this to Inf if you want the same behavior as in earlier R versions (than 2.14.x).
(只用时log是真的):近似(较低的约束)数刻度间隔,默认为par("lab")[j]其中j是1或2取决于side。设置为Inf如果你想在早期的R版本(比2.14.x)相同的行为。


Details

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

The axp, usr, and log arguments must be consistent as their default values (the par(..) results) are.  If you specify all three (as non-NULL), the graphics environment is not used at all.  Note that the meaning of axp differs significantly when log is TRUE; see the documentation on par(xaxp=.).
axp,usr,log参数必须为它们的默认值(par(..)结果)一致。如果你指定所有三个(非NULL),在不使用图形环境。注意的含义axp显着不同的时候log是TRUE;看到par(xaxp=.)的文件。

axTicks() can be used an R interface to the C function CreateAtVector() in "..../src/main/plot.c" which is called by axis(side,*) when no argument at is specified. The delicate case, log = TRUE, now makes use of axisTicks (in package grDevices) unless nintLog = Inf which exists for back compatibility.
axTicks()R接口,可用于C函数CreateAtVector()..../src/main/plot.c这被称为axis(side,*)时没有参数at指定。微妙的情况下,log = TRUE,现在利用(包axisTicks)grDevices除非nintLog = Inf这回的兼容性存在。


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

numeric vector of coordinate values at which axis tickmarks can be drawn.  By default, when only the first argument is specified, these values should be identical to those that axis(side) would use or has used.  Note that the values are decreasing when usr is (“reverse axis” case).
数字可以得出在轴tickmarks的坐标值向量。默认情况下,只有第一个参数被指定时,这些值应该是相同的axis(side)将使用或已使用。请注意,值降低时usr(“反向轴”的情况下)。


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

axis, par.  pretty uses the same algorithm (but independently of the graphics environment) and has more options.  However it is not available for log = TRUE.
axis,par。 pretty使用相同的算法(但独立的图形环境),并有更多的选择。然而,它是不log = TRUE.

axisTicks() (package grDevices).
axisTicks()(包grDevices)。


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


plot(1:7, 10*21:27)
axTicks(1)
axTicks(2)
stopifnot(identical(axTicks(1), axTicks(3)),
           identical(axTicks(2), axTicks(4)))

## Show how axTicks() and axis() correspond :[#显示如何axTicks()和轴()对应:]
op <- par(mfrow = c(3,1))
for(x in 9999*c(1,2,8)) {
    plot(x,9, log = "x")
    cat(formatC(par("xaxp"), width=5),";", T <- axTicks(1),"\n")
    rug(T, col= adjustcolor("red", 0.5), lwd = 4)
}
par(op)

x <- 9.9*10^(-3:10)
plot(x, 1:14, log = "x")
axTicks(1) # now length 5, in R &lt;= 2.13.x gave the following[现在长度为5,在R <= 2.13.x了以下]
axTicks(1, nintLog=Inf) # rather too many[得太多了]

## An example using axTicks() without reference to an existing plot[#一个例子使用axTicks()不参照现有的图]
## (copying R's internal procedures for setting axis ranges etc.),[#(复制R的内部程序设置轴范围等),]
## You do need to supply _all_ of axp, usr, log, nintLog[#你需要提供_all_ AXP,USR,日志,nintLog]
## standard logarithmic y axis labels[#标准对数Y轴标签]
ylims <- c(0.2, 88)
get_axp <- function(x) 10^c(ceiling(x[1]), floor(x[2]))
## mimic par("yaxs")=="i"[#模仿看齐(“yaxs”)==“我”]
usr.i <- log10(ylims)
(aT.i <- axTicks(side=2, usr=usr.i,
                 axp=c(get_axp(usr.i), n=3), log=TRUE, nintLog=5))
## mimic (default) par("yaxs")=="r"[#模仿(默认)看齐(“yaxs”)==“R”]
usr.r <- extendrange(r = log10(ylims), f = 0.04)
(aT.r <- axTicks(side=2, usr=usr.r,
                 axp=c(get_axp(usr.r),3), log=TRUE, nintLog=5))

## Prove that we got it right :[#证明,我们这样做是正确的:]
plot(0:1,ylims,log="y",yaxs="i")
stopifnot(all.equal(aT.i, axTicks(side=2)))

plot(0:1,ylims,log="y",yaxs="r")
stopifnot(all.equal(aT.r, axTicks(side=2)))

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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-1-23 21:21 , Processed in 0.022880 second(s), 15 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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