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

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

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

                                        Plot Annotation
                                         图诠释

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

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

This function can be used to add labels to a plot.  Its first four principal arguments can also be used as arguments in most high-level plotting functions.  They must be of type character or expression. In the latter case, quite a bit of mathematical notation is available such as sub- and superscripts, greek letters, fractions, etc: see plotmath
此功能可用于添加标签的图。其前四个主要论点,也可以用在最高层绘图函数的参数。他们必须是类型character或expression。在后一种情况下,相当多的数学符号位是可用的,如分标,希腊字母,分数等:看到plotmath


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


title(main = NULL, sub = NULL, xlab = NULL, ylab = NULL,
      line = NA, outer = FALSE, ...)



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

参数:main
The main title (on top) using font and size (character expansion) par("font.main") and color par("col.main").
主标题(顶部)使用的字体和大小(字符扩展)par("font.main")颜色par("col.main")。


参数:sub
Sub-title (at bottom) using font and size par("font.sub") and color par("col.sub").
副标题(底部)使用的字体和大小par("font.sub")颜色par("col.sub")。


参数:xlab
X axis label using font and character expansion par("font.lab") and color par("col.lab").
使用X轴标签的字体和字符扩张par("font.lab")颜色par("col.lab")。


参数:ylab
Y axis label, same font attributes as xlab.
Y轴的标签,为xlab相同的字体属性。


参数:line
specifying a value for line overrides the default placement of labels, and places them this many lines outwards from the plot edge.
指定line价值覆盖标签的默认位置,并置于他们的很多线从小区边缘向外。


参数:outer
a logical value.  If TRUE, the titles are placed in the outer margins of the plot.
一个逻辑值。如果TRUE,标题中的图外边缘放置。


参数:...
further graphical parameters from par.  Use e.g., col.main or cex.sub instead of just col or cex.  adj controls the justification of the titles. xpd can be used to set the clipping region: this defaults to the figure region unless outer = TRUE, otherwise the device region and can only be increased.  mgp controls the default placing of the axis titles.  
par进一步的图形参数。使用,例如,col.main或cex.sub,而不是仅仅col或cex。 adj控制标题的理由。 xpd可用于设置裁剪区域:这个默认的数字区域,除非outer = TRUE,否则设备区域和只能增加。 mgp控制默认配售轴标题。


Details

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

The labels passed to title can be character strings or language objects (names, calls or expressions), or a list containing the string to be plotted, and a selection of the optional modifying graphical parameters cex=, col= and font=.  Other objects will be coerced by as.graphicsAnnot.
标签传递给title可以是字符串或语言对象(姓名,电话或词句),或包含要绘制的字符串列表,并选择可选的图形参数修改cex=, col=和font=。其他对象将被裹挟as.graphicsAnnot。

The position of main defaults to being vertically centered in (outer) margin 3 and justified horizontally according to par("adj") on the plot region (device region for outer=TRUE).
main默认的位置被垂直集中在3(外)保证金和合理的水平根据积区par("adj")(outer=TRUE的设备区域“)。

The positions of xlab, ylab and sub are line (default for xlab and ylab being par("mgp")[1] and increased by 1 for sub) lines (of height par("mex")) into the appropriate margin, justified in the text direction according to par("adj") on the plot/device region.
的职位xlab,ylab和sub是line(默认为xlab和ylab是par("mgp")[1]和增加1sub)线(高度par("mex"))到相应的保证金,合理的文字方向,根据par("adj")剧情/设备区域。


参考文献----------References----------

The New S Language. Wadsworth & Brooks/Cole.

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

mtext, text; plotmath for details on mathematical annotation.
mtext,text;plotmath数学注释的细节。


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


plot(cars, main = "") # here, could use main directly[在这里,可以直接使用的主要]
title(main = "Stopping Distance versus Speed")

plot(cars, main = "")
title(main = list("Stopping Distance versus Speed", cex=1.5,
                  col="red", font=3))

## Specifying "..." :[#指定“......” :]
plot(1, col.axis = "sky blue", col.lab = "thistle")
title("Main Title", sub = "sub title",
      cex.main = 2,   font.main= 4, col.main= "blue",
      cex.sub = 0.75, font.sub = 3, col.sub = "red")


x <- seq(-4, 4, len = 101)
y <- cbind(sin(x), cos(x))
matplot(x, y, type = "l", xaxt = "n",
        main = expression(paste(plain(sin) * phi, "  and  ",
                                plain(cos) * phi)),
        ylab = expression("sin" * phi, "cos" * phi), # only 1st is taken[只有第一次采取]
        xlab = expression(paste("Phase Angle ", phi)),
        col.main = "blue")
axis(1, at = c(-pi, -pi/2, 0, pi/2, pi),
     labels = expression(-pi, -pi/2, 0, pi/2, pi))
abline(h = 0, v = pi/2 * c(-1,1), lty = 2, lwd = .1, col = "gray70")

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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-5-4 18:48 , Processed in 0.020464 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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