Skip to content

How to display y-axis labels in Multcomp plot

3 messages · Kingsford Jones, Metconnection

#
Dear R-users, 
I'm currently using the multcomp package to produce plots of means with 95%
confidence intervals
i.e.

mult<-glht(lm(response~treatment, data=statdata),
linfct=mcp(treatment="Means"))
plot(confint(mult,calpha = sig))

Unfortunately the y-axis on the plot appears to be fixed and hence if the
labels on the y-axis (treatment levels) are too long, then they are not
displayed in full on the plot. Of course I could always make the labels
shorter but I was wondering if there was a way to make the position of the
y-axis on the plot more flexible, such as in the scatterplot produced using
xyplot function, that would allow me to view the labels in full.

Thanks in advance for any advice!
Simon
#
See ?par and note the 'mar' parameter

Here's an example:


library(multcomp)
labs <- c('short', 'medium', 'looooooooong')
treatment <- gl(3, 10, labels = labs)
response <- rnorm(30, mean=as.numeric(treatment))
mult <- glht(lm(response ~ treatment),
        linfct=mcp(treatment='Means'))
par(mar=c(4,8,4,2))
plot(confint(mult))

hth,

Kingsford Jones
On Mon, Dec 8, 2008 at 5:06 PM, Metconnection <simontbate at hotmail.co.uk> wrote: