mtext(text, side = 3, line = 0, outer = FALSE, at = NA,
adj = NA, padj = NA, cex = NA, col = NA, font = NA, …)
as.graphicsAnnot
.at
corresponding to a particular text item is
not a finite value (the default), the location will be determined
by adj
.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
). 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.
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.NA
values (the
default) mean use par("col")
.NA
values (the
default) mean use par("font")
.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.)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. 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.) 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. Graphics parameter "ylbias"
(see par
) determines
how the text baseline is placed relative to the nominal line.title
, text
, plot
,
par
;
plotmath
for details on mathematical annotation.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)
Run the code above in your browser using DataLab