Skip to content
Prev 68094 / 398521 Next

Label / Tick under single Boxplot

On Wed, 2005-04-20 at 02:08 +0200, Werner Wernersen wrote:
Werner,

Just to be sure that you do want a boxplot and not a barplot, as in the
former case, the 'beside=F' is unused.

Presuming that you do want a boxplot, there is the following code in the
bxp() function, which actually does the plotting:

 if (is.null(show.names)) 
    show.names <- n > 1
 if (show.names) 
    do.call("axis", c(list(side = 1 + horizontal, at = at, 
            labels = z$names), ax.pars))

The result of the first if() statement in the case of a single group (n
= 1) is that the names are not plotted.

Thus, you can do the following:

boxplot(3:5)
axis(1, at = 1, "a")

Presuming that you do not modify the 'at' argument in the call to
boxplot(), the boxes are by default drawn at integer values on the x
axis, which in this case is 1.

HTH,

Marc Schwartz