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

From: Patrick Giraudoux <>
Date: Mon, 28 May 2007 09:53:02 +0200

Deepayan Sarkar a écrit :
> 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
Yes indeed. Thats' likely what I am going to do. Anyway, to plot axes, labels of sophisticated graphs on maps may be interesting anyway. For instance, we are monitoring fox and hare populations in tens of game areas. Drawing observations (panel.xyplot) over time and representing the trend variations (panel.loess) at the very place on the map where the observations were done gives an absolutely interesting view where spatial relationships between trends can be visualized.

Patrick mailing list PLEASE do read the posting guide and provide commented, minimal, self-contained, reproducible code. Received on Mon 28 May 2007 - 07:58:19 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 - 14:31:42 GMT.

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