[Rd] boxplot ignores 'boxfill' (PR#9352)

arnima at u.washington.edu arnima at u.washington.edu
Wed Nov 8 21:14:31 CET 2006


The boxplot.default() function ignores argument 'boxfill' passed by user:

     x <- rnorm(100)
     boxplot(x, boxfill="blue")
     boxplot(x, pars=list(boxfill="green"))

As the original creator of the 'boxfill' argument, I'd like to propose the 
following change to the if(plot) clause in boxplot.R:

     if(plot) {
         if(is.null(pars$boxfill) && is.null(args$boxfill))
             pars$boxfill <- col
         do.call("bxp",
             c(list(z, notch=notch, width=width, varwidth=varwidth,
             outline=outline, log=log, border=border, pars=pars,
             horizontal=horizontal, add=add, at=at), args[namedargs]))
         invisible(z)
     }


What I've done is (1) setting boxfill=col only when that is desired, (2) 
named the 'width' list element to avoid confusion, and (3) rearranged the 
list so it has the same order as args(bxp).

Thanks,
Arni

R 2.4.0-patched on WinXP



More information about the R-devel mailing list