mtext(graphics)
mtext()所属R语言包:graphics
Write Text into the Margins of a Plot
写文本到图的边缘
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Text is written in one of the four margins of the current figure region or one of the outer margins of the device region.
文本被写入在目前的数字设备区外边缘区域或四个边缘之一。
用法----------Usage----------
mtext(text, side = 3, line = 0, outer = FALSE, at = NA,
adj = NA, padj = NA, cex = NA, col = NA, font = NA, ...)
参数----------Arguments----------
参数:text
a character or expression vector specifying the text to be written. Other objects are coerced by as.graphicsAnnot.
字符或表达向量,指定要写入的文字。其他对象被强制as.graphicsAnnot。
参数:side
on which side of the plot (1=bottom, 2=left, 3=top, 4=right).
哪一方的图(1 =底部,2 =左,3 =顶部,4 =右)。
参数:line
on which MARgin line, starting at 0 counting outwards.
上边缘线,在0票向外开始。
参数:outer
use outer margins if available.
如果可用,使用外利润率。
参数:at
give location of each string in user coordinates. If the component of at corresponding to a particular text item is not a finite value (the default), the location will be determined by adj.
给每个用户坐标串的位置。如果at对应一个特定的文本项目的组成部分,是不是一个有限值(默认),位置将取决于adj。
参数:adj
adjustment for each string in reading direction. For strings parallel to the axes, adj = 0 means left or bottom alignment, and adj = 1 means right or top alignment. If adj is not a finite value (the default), the value of par("las") determines the adjustment. For strings plotted parallel to the axis the default is to centre the string.
调整为每串阅读方向。轴平行的字符串,adj = 0指左侧或底部对齐,adj = 1意味着权利或顶部对齐。如果adj是不是一个有限值(默认)值par("las")决定调整。对于字符串绘制平行于轴线默认为中心的字符串。
参数:padj
adjustment for each string perpendicular to the reading direction (which is controlled by adj). For strings parallel to the axes, padj = 0 means right or top alignment, and padj = 1 means left or bottom alignment. If padj is not a finite value (the default), the value of par("las") determines the adjustment. For strings plotted perpendicular to the axis the default is to centre the string.
每根弦垂直的阅读方向调整(这是由adj控制)。轴平行的字符串,padj = 0是指权利或顶部对齐,padj = 1是指左侧或底部对齐。如果padj是不是一个有限值(默认)值par("las")决定调整。对于字符串绘制垂直轴默认为中心的字符串。
参数:cex
character expansion factor. NULL and NA are equivalent to 1.0. This is an absolute measure, not scaled by par("cex") or by setting par("mfrow") or par("mfcol"). Can be a vector.
字符膨胀系数。 NULL和NA1.0是等价的。这是一个绝对的衡量,而不是由par("cex")设置par("mfrow")或par("mfcol")缩放。可以是一个向量。
参数:col
color to use. Can be a vector. NA values (the default) mean use par("col").
要使用的颜色。可以是一个向量。 NA值(默认)意味着使用par("col")。
参数:font
font for text. Can be a vector. NA values (the default) mean use par("font").
文本的字体。可以是一个向量。 NA值(默认)意味着使用par("font")。
参数:...
Further graphical parameters (see par), including family, las and xpd. (The latter defaults to the figure region unless outer = TRUE, otherwise the device region. It can only be increased.)
进一步的图形参数(见par),包括family,las和xpd。 (图区域,除非outer = TRUE,否则设备的区域。它只能增加后者的默认。)
Details
详情----------Details----------
The user coordinates in the outer margins always range from zero to one, and are not affected by the user coordinates in the figure region(s) — R differs here from other implementations of S.
用户坐标外的利润率始终范围从零到一的,而不是由用户坐标图中的区域(S)的影响 - R的不同,在这里与其他的实现
All of the named arguments can be vectors, and recycling will take place to plot as many strings as the longest of the vector arguments.
命名参数可以是向量,和回收将采取许多字符串最长的向量参数进行绘图。
Note that a vector adj has a different meaning from text. adj = 0.5 will centre the string, but for outer=TRUE on the device region rather than the plot region.
注意,矢量adj有不同的含义从text。 adj = 0.5中心的字符串,但outer=TRUE图区域的设备,而不是区域。
Parameter las will determine the orientation of the string(s). For strings plotted perpendicular to the axis the default justification is to place the end of the string nearest the axis on the specified line. (Note that this differs from S, which uses srt if at is supplied and las if it is not. Parameter srt is ignored in R.)
参数las会确定的字符串(S)的方向。为字符串绘制垂直轴默认的理由是最接近轴放置在指定行的字符串的结尾。 (请注意,这从S,使用srt如果at供应和las如果不是在河忽略。参数srt不同)
Note that if the text is to be plotted perpendicular to the axis, adj determines the justification of the string and the position along the axis unless at is specified.
请注意,如果文本是要绘制垂直轴,adj决定沿中轴线的位置和字符串的理由,除非at指定。
Graphics parameter "ylbias" (see par) determines how the text baseline is placed relative to the nominal line.
图形参数"ylbias"(见par)决定如何放在相对的名义行文本的基线。
副作用----------Side Effects----------
The given text is written onto the current plot.
给定的文本写入到当前的图。
参考文献----------References----------
The New S Language. Wadsworth & Brooks/Cole.
参见----------See Also----------
title, text, plot, par; plotmath for details on mathematical annotation.
title,text,plot,par;plotmath数学注释的细节。
举例----------Examples----------
plot(1:10, (-4:5)^2, main="Parabola Points", xlab="xlab")
mtext("10 of them")
for(s in 1:4)
mtext(paste("mtext(..., line= -1, {side, col, font} = ",s,
", cex = ", (1+s)/2, ")"), line = -1,
side=s, col=s, font=s, cex= (1+s)/2)
mtext("mtext(..., line= -2)", line = -2)
mtext("mtext(..., line= -2, adj = 0)", line = -2, adj =0)
##--- log axis :[#---日志轴:]
plot(1:10, exp(1:10), log='y', main="log='y'", xlab="xlab")
for(s in 1:4) mtext(paste("mtext(...,side=",s,")"), side=s)
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|