[R] Help in the mtext function

RAVI KAPOOR ravkaps at gmail.com
Mon Oct 5 04:53:30 CEST 2009


Can anyone please help me in understanding the utility of  "padj" and "outer
(logical)" values in the '*mtext function*'
given below are the output I generated on using the below code which is
different from the formula description on r help

> par(mfrow=c(2,1),xpd=NA)
> y1 <- rnorm(100)
> plot(y1,ann=F,axes=F,type="l")
> box(col="blue")
> mtext("aone",side=1,padj=0)
> mtext("aone",side=1,padj=1)
> mtext("aone",side=2,padj=1)
> mtext("aone",side=2,padj=0)

and the output is in the attached jpeg
This is different from the r help description
padj adjustment for each string perpendicular to the reading direction
(which is controlled by adj). For strings parallel to the axes, padj =
0means right or top alignment, and padj
= 1 means left or bottom alignment.
Also please explain the utility of setting outer = TRUE/FALSE # I know that
logical values permit/prohibit use of outer region but again I am unable to
see that happening

> box(col="blue")
> mtext("aone",side=1,adj=0,outer=F)
> mtext("aone",side=1,adj=0,outer=T)
> # nothing changes when I change the settings of outer from false to true-
> mtext("aone",side=3,adj=0,outer=T)
> # again nothing happens why?
> mtext("aone",side=3,adj=0,outer=F)

(please see mtext2.jpg for the output that I am generating for different
logical values of Outer)

Thanks in advance for the help


More information about the R-help mailing list