From ligges@statistik.uni-dortmund.de  Thu Feb  7 21:59:16 2002
From: ligges@statistik.uni-dortmund.de (ligges@statistik.uni-dortmund.de)
Date: Thu, 7 Feb 2002 22:59:16 +0100 (MET)
Subject: [Rd] FW: layout and piechart diameter problem (PR#1300)
Message-ID: <200202072159.WAA07049@pubhealth.ku.dk>



Uwe Ligges wrote:
> 
> gregory_r_warnes@groton.pfizer.com wrote:
> >
> > Third try...
> >
> > >  -----Original Message-----
> > > From:         Warnes, Gregory R
> > > Sent: Tuesday, February 05, 2002 4:12 PM
> > > To:   'R-bugs'
> > > Subject:      layout and piechart diameter problem
> > >
> > >
> > > I've been using layout to create some graphics pages which include pie
> > > charts.   (NB: No piechart arguments please, the main chart on the page is
> > > a proper bar chart representing the same information.)
> > >
> > > When I plot pie charts in a column, the piechart at the top of a column is
> > > always smaller than the others:
> > >
> > > For example:
> > >
> > >       layout( matrix(c(1,1,2,
> > >                        1,1,3,
> > >                        1,1,4), ncol=3, byrow=T))
> > >       for(i in 1:4) piechart( 1:3 )
> > >
> > > In column 3, the first piechart has a radius something like 2/3 of the
> > > others.
> > >
> > > This also happens for:
> > >
> > >       layout( matrix(c(1,2,
> > >                        1,3,
> > >                        1,4), ncol=2, byrow=T))
> > >       for(i in 1:4) piechart( 1:3 )
> > >
> > >
> > > For this:
> > >
> > >       layout( matrix(c(1,3,
> > >                        1,4,
> > >                        2,5), ncol=2, byrow=T))
> > >       for(i in 1:5) piechart( 1:3 )
> > >
> > > the piechart at the bottom left is smaller than the three in the second
> > > column:
> > >
> > >
> > > This occurs both on the x11 and postscript devices, although it is less
> > > noticeable on the latter.  It doesn't seem happen for 'hist' or 'plot'. As
> > > I've only recently started using layout, I don't know if this occurs with
> > > other plotting devices or commands.
> 
> Probably only if the functions are making use of par("pin") (and friends
> ?) as piechart() does:
> 
> layout(matrix(c(1,1,2, 1,1,3, 1,1,4), ncol=3, byrow=TRUE))
> par("pin")
> plot(1); par("pin")  # Here it goes wrong for the next plot.
> plot(1); par("pin")
> plot(1); par("pin")
> plot(1)

And let me add, it is everytime the second one:

layout(matrix(c(1,3, 1,4, 2,5), ncol=2, byrow=TRUE))
for(i in 1:5) piechart( 1:3 )

layout(matrix(c(1,2, 1,4, 3,5), ncol=2, byrow=TRUE))
for(i in 1:5) piechart( 1:3 )

layout(matrix(c(1,3, 1,2, 4,5), ncol=2, byrow=TRUE))
for(i in 1:5) piechart( 1:3 )

Uwe

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._


[Rd] FW: layout and piechart diameter problem (PR#1300)
ligges@statistik.uni-dortmund.de