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

R语言 sfsmisc包 axTexpr()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-9-30 01:35:35 | 显示全部楼层 |阅读模式
axTexpr(sfsmisc)
axTexpr()所属R语言包:sfsmisc

                                        Axis Ticks Expressions in Nice 10 ** k Form
                                         轴刻度线尼斯10 ** K表格中的表达式

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

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

Produce nice a * 10^k expressions for axis labeling instead of the scientific notation "a E<k>".
产生很好a * 10^k标签,而不是科学记数法axis"a E<k>"表达式。


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


axTexpr(side, at = axTicks(side, axp = axp, usr = usr, log = log),
        axp = NULL, usr = NULL, log = NULL,
        drop.1 = FALSE)



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

参数:side
integer in 1:4 specifying the axis side, as for axis.
1:4整数,指定轴上方,为axis。


参数:at
numeric vector; with identical default as in axTicks().
数字矢量具有相同的默认axTicks()。


参数:axp, usr, log
as for axTicks().
如为axTicks()。


参数:drop.1
logical indicating if 1 * should be dropped from the resulting expressions.
逻辑1 *如果生成的表达式应该被丢弃。


Details

详细信息----------Details----------

This is just a utility with the same arguments as axTicks, calling pretty10exp(at, *).
这仅仅是一个实用程序,相同的参数axTicks,呼吁pretty10exp(at, *)。


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

an expression of the same length as x, with elements of the form a %*% 10 ^ k.
的表达式相同的长度x,与形式a %*% 10 ^ k的元素。


(作者)----------Author(s)----------


Martin Maechler



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

pretty10exp; axis, axTicks.
pretty10exp,axis,axTicks。


实例----------Examples----------


x <- 1e7*(-10:50)
y <- dnorm(x, m=10e7, s=20e7)
plot(x,y)## not really nice,  the following is better:[#不是真的不错,下面是更好的:]

## For horizontal y-axis labels, need more space:[#水平y轴的标签,需要更多的空间:]
op <- par(mar= .1+ c(5,5,4,1))
plot(x,y, axes= FALSE, frame=TRUE)
aX <- axTicks(1); axis(1, at=aX, label= axTexpr(1, aX))
## horizontal labels on y-axis:[#y轴水平上的标签:]
aY <- axTicks(2); axis(2, at=aY, label= axTexpr(2, aY), las=2)
par(op)

### -- only 'x' and using log-scale there:[## - x和使用log有规模:]
plot(x,y, xaxt= "n", log = "x")
aX <- axTicks(1); axis(1, at=aX, label= axTexpr(1, aX))

## Now an `` engineer's version '' ( more ticks; only label "10 ^ k" ) :[#现在工程师的版本“(刻度线,只有标签”10 ^ K“):]

axp &lt;- par("xaxp") #-&gt; powers of 10 *inside* 'usr'[ - > 10的幂*内*“USR”]
axp[3] &lt;- 1 # such that only 10^. are labeled[这样,只有10 ^。被标记]
aX <- axTicks(1, axp = axp)
xu <- 10 ^ par("usr")[1:2]
e10 &lt;- c(-1,1) + round(log10(axp[1:2])) ## exponents of 10 *outside* 'usr'[#指数* 10 *外的“USR”]
v <- c(outer(1:9, e10[1]:e10[2], function(x,E) x * 10 ^ E))
v <- v[xu[1] <= v &amp; v <= xu[2]]

plot(x,y, xaxt= "n", log = "x", main = "engineer's version of x - axis")
axis(1, at = aX, label = axTexpr(1, aX, drop.1=TRUE)) # `default'[默认]
axis(1, at = v,  label = FALSE, tcl = 2/3 * par("tcl"))

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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-5-21 06:43 , Processed in 0.025913 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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