[R] why are my multiple box & whisker plots so small?
rolf at math.unb.ca
rolf at math.unb.ca
Wed Dec 13 18:51:59 CET 2006
> I'm sure this is reallly basic, but I just can get it to work. I want
> to plot six box & whisker plots together to make one figure so that
> they appear one below the next.
>
> I can do this using >par(mfrow=c(6,1)), but each box&whisker plots
> end up vertically compressed to the point where I can't see the
> actual bars, and there is a large amount of white space between each
> one.
>
> I have tried reducing the margins using "mar", but nothing happens.
You must be plotting them verically --- which is silly.
There is simply no room to stack them vertically above each
other. This is a sub-optimal way of going at it anyway.
I.e. you could do:
par(mfrow=c(6,1),mar=c(0,3,0,2))
boxplot(x1,horizontal=TRUE)
.
.
.
boxplot(x6,horizontal=TRUE)
where x1, ..., x6 are your 6 data sets, and get an
almost-reasonable plot. But the axes are cramped and the
alignment is out of whack.
Much better to do:
boxplot(list(x1,x2,x3,x4,x5,x6),horizontal=TRUE)
the possibility of which is indicated in the help,
which I suggest you read.
> I've also tried using "plt" to make the plot area bigger, but this
> has no effect either.
If things don't fit, they don't fit. Wonderful as it is,
R can't work magic.
cheers,
Rolf Turner
rolf at math.unb.ca
More information about the R-help
mailing list