Skip to content
Prev 42693 / 63424 Next

plot.TukeyHSD prints funny main titles

Hi,

if you use the plot.TukeyHSD() function with a main argument, that one
is printed over the default title 'X% family-wise confidence level'.
Try for example:

Model <- aov(count~spray,data=InsectSprays)
plot(TukeyHSD(Model),main='HHHHH',las=2)

This doesn't happen with an xlab or ylab argument, as they give errors
due to the fact they're specified inside the function already:

function (x, ...)
{
    for (i in seq_along(x)) {
        ...
        plot(c(xi[, "lwr"], xi[, "upr"]), rep.int(yvals, 2),
            type = "n", axes = FALSE, xlab = "", ylab = "", ...)
        ...
    }
}

The main title and the xlab are created with the title() function
lower in the code. So to avoid a main title being specified twice, I
propose to add main="" to the plot statement quoted above.

Cheers
Joris