[R] Variable panel sizes in box plot

Jim Lemon jim at bitwrit.com.au
Mon Aug 5 00:43:13 CEST 2013


On 08/05/2013 08:01 AM, Aziz, Muhammad Fayez wrote:
>
> Hi,
>
> My question is how to make panel sizes variable in box plots. I mean if a panel has 10 box plots and another has only two, I need to make the later panel thinner than the first.
>
Hi Fayex,
Try this:

xdat<-data.frame(a=rnorm(100),b=rnorm(100),c=rnorm(100),d=rnorm(100),
  e=rnorm(100),f=rnorm(100),g=rnorm(100))
dev.new(width=10,height=3)
layout(matrix(1:2,nrow=1),widths=c(5,2))
boxplot(xdat[1:5])
boxplot(xdat[6:7])

Jim



More information about the R-help mailing list