[R] Variable panel sizes in box plot

Aziz, Muhammad Fayez aziz4 at illinois.edu
Mon Aug 5 01:20:54 CEST 2013


Hi Jim,

Your example works perfectly. Any possibility that the sizing could be automated. I am using bwplot. I can also use a prepanel function if needed. Please find attached the code, data and output.

Fayez

________________________________________
From: Jim Lemon [jim at bitwrit.com.au]
Sent: Sunday, August 04, 2013 5:43 PM
To: Aziz, Muhammad Fayez
Cc: r-help at r-project.org
Subject: Re: [R] Variable panel sizes in box plot

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
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: PanelSizeData.txt
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20130804/2f1131cc/attachment.txt>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PanelSizeData.png
Type: image/png
Size: 16130 bytes
Desc: PanelSizeData.png
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20130804/2f1131cc/attachment.png>


More information about the R-help mailing list