Re: [R] pie chart in lattice - trellis class

From: Deepayan Sarkar <>
Date: Sun, 27 May 2007 15:21:31 -0700

On 5/27/07, Patrick Giraudoux <> wrote:
> Dear all,
> After going through the Lattice doc and R-help list and google, I got
> the feeling that there is no function in lattice or other package to
> compute a pie chart object of class "trellis". Although pie charts are
> obviously not considered optimal even in the pie() doc ;-) , pie chart
> trellis objects would be easy positioned e.g. over a map drawn with the
> grids package.
> Can anybody confirm this absence or indicate a package/function able to
> draw a pie chart object of class trellis?

I can confirm that lattice does not produce "trellis" objects representing pie charts (although I guess it can be made to do so with a user supplied panel function). However, I don't see how that would have helped you with the map example, as plotting a "trellis" object would also include the axes, labels, etc. What you really want is the ability to draw a circle with differently colored angular segments, which can be reasonably approximated by polygons. polygon() and grid.polygon() do these for traditional and grid graphics respectively.

-Deepayan mailing list PLEASE do read the posting guide and provide commented, minimal, self-contained, reproducible code. Received on Sun 27 May 2007 - 22:27:00 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 28 May 2007 - 08:31:07 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.