Hi all, 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. I've also tried using "plt" to make the plot area bigger, but this has no effect either. Can anyone help? Many thanks in advance, Ellen. --
rolf at math.unb.ca
2006-Dec-13 17:51 UTC
[R] why are my multiple box & whisker plots so small?
> 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
Francisco J. Zagmutt
2006-Dec-13 18:13 UTC
[R] why are my multiple box & whisker plots so small?
Please remember to add a sample of reproducible code when you post to this list (as recommended in the posting guide). You probably want to use the lattice package i.e. library(lattice) ?bwplot Francisco Ellen Husain wrote:> Hi all, > > 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. I've > also tried using "plt" to make the plot area bigger, but this has no > effect either. > > Can anyone help? > > Many thanks in advance, > > Ellen. > > -- > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >