Using Splus6.1 on a Sun.
We're trying to create parallel boxplots -- let's say four -- but there
are really two groups of two.
Therefore we'd like more space between boxes 2 and 3 than between (1 & 2)
and (3 & 4).
Therefore instead of the boxes being placed at
x = 15.00000 38.33333 61.66666 85.00000
we'd like to make slightly thinner boxes at:
x = 15, 30, 70, 85
or with five boxes and just omitting the middle one:
x = 12.22222 31.11111 50.00000 68.88889 87.77778
There is little in the help(boxplot) that covers this other than
"Horizontal spacing and box widths are an implementation detail that is
subject to change."
What does that mean?
I've figured out to do it the following way creating an unwanted box
between boxes 2 and 3 then putting a white filled polygon over top this
box:
group <- rep(c(1,2,2.5,3,4), rep(20,5))
y <- rnorm(100)
boxplot(split(y, group), ylim=c(-3,4), names=c("1","2","","3","4"),
style.bxp = "old")
polygon(c(40,60,60,40), c(-3,-3,4,4), density=-1, col=0)
abline(v=50)
But that seems archaic and I suspect there is an easier way to control the
x positions of the boxplots.
Any help would be much appreciated.
Please direct any responses to me and my colleague Julie who is cc'd
above.
Thanks very much.
Jason
|