bolker@zoo.ufl.edu
2001-Oct-22  15:51 UTC
[Rd] cex/col/etc. in title(): documentation? (PR#1136)
There appears to be a mismatch between the documentation and behavior of
title(), or at least a clarification is in order.  The documentation says
you can pass extra arguments from par() as "...".  However, cex at
least
is ignored. Later on in the documentation it becomes clear that you can
specify these extra parameters as part of a list.
  I wouldn't say this is necessarily a bug (and there's certainly a way
to
do what you want, if you read the rest of the documentation), but I will
say it didn't seem to follow the same conventions as most of the rest of
the graphical annotation in R.  I would have expected
title(main="foo",cex=2) to set the title larger ...
  I think it would be nicer if title() worked this way, but if it doesn't
it would be nice to have an additional note in the documentation for
"..."
to the effect that parameters such as cex, col, etc., should be set using
the list mechanism described below.
## setting parameter with par(): works
par(mfrow=c(3,3),cex=1)
for (i in 1:9) {
  plot(0:5)
  par(cex=i)
  title(main="hello")
  par(cex=1)
}
## passing parameter as part of a list: works
par(mfrow=c(3,3),cex=1)
for (i in 1:9) {
  plot(0:5)
  title(main=list("hello",cex=i))
  par(cex=1)
}
## passing cex as an additional arg: doesn't work
par(mfrow=c(3,3))
for (i in 1:9) {
  plot(0:5)
  title(main="hello",cex=i)
}
--please do not edit the information below--
Version:
 platform = i686-pc-linux-gnu
 arch = i686
 os = linux-gnu
 system = i686, linux-gnu
 status  major = 1
 minor = 3.1
 year = 2001
 month = 08
 day = 31
 language = R
Search Path:
 .GlobalEnv, package:bbfuns, package:cannib, package:ctest, Autoloads,
package:base
-- 
318 Carr Hall                                bolker@zoo.ufl.edu
Zoology Department, University of Florida    http://www.zoo.ufl.edu/bolker
Box 118525                                   (ph)  352-392-5697
Gainesville, FL 32611-8525                   (fax) 352-392-3704
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To:
r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
maechler@stat.math.ethz.ch
2001-Oct-31  10:23 UTC
[Rd] cex/col/etc. in title(): documentation? (PR#1136)
>>>>> "Ben" == Ben Bolker <bolker@zoo.ufl.edu> writes:Ben> There appears to be a mismatch between the documentation and Ben> behavior of title(), or at least a clarification is in order. The Ben> documentation says you can pass extra arguments from par() as Ben> "...". However, cex at least is ignored. Later on in the Ben> documentation it becomes clear that you can specify these extra Ben> parameters as part of a list. No bug. Here's the clarification: Contrary to the other implementations of S, R differentiates different usages of "cex", "col" and "font" : > .Pars[grep("^cex",.Pars)] [1] "cex" "cex.axis" "cex.lab" "cex.main" "cex.sub" > .Pars[grep("^col",.Pars)] [1] "col" "col.axis" "col.lab" "col.main" "col.sub" > .Pars[grep("^font",.Pars)] [1] "font" "font.axis" "font.lab" "font.main" "font.sub" and ?par *does* document this. Hence the "..." in axis() should really be ``filled'' with cex.axis, etc. Ben> I wouldn't say this is necessarily a bug (and there's certainly Ben> a way to do what you want, if you read the rest of the Ben> documentation), but I will say it didn't seem to follow the same Ben> conventions as most of the rest of the graphical annotation in R. Ben> I would have expected title(main="foo",cex=2) to set the title Ben> larger ... The following is an example demonstrating R's possibilities (not as cleanly possible in S-plus AFAIK): 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") Martin Maechler <maechler@stat.math.ethz.ch> http://stat.ethz.ch/~maechler/ Seminar fuer Statistik, ETH-Zentrum LEO D10 Leonhardstr. 27 ETH (Federal Inst. Technology) 8092 Zurich SWITZERLAND phone: x-41-1-632-3408 fax: ...-1228 <>< -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-devel-request@stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._