Re: [R] display two pie-charts

From: Barry Rowlingson <B.Rowlingson_at_lancaster.ac.uk>
Date: Wed 11 May 2005 - 23:59:31 EST

Lars wrote:

> i'd like to compose a clock-like looking plot composed out of two
> circles, each showing the length of a period (to compare them). first,
> to do so, it looked the easiest by using pie(), just puting multiple
> pie-charts over each other. the problem is that once the second pie is
> drawn, it replaces the first one. does anybody know how to add a second,
> smaller pie over an existing one, like a layer?

  pie() calls plot.new(), thus creating a new plot. Comment out the plot.new call and you'll have a pie() function that splats over the current plot.

  Suggest you copy 'pie' to something of your own:

  > clock = pie

  Then edit the 'clock' function, removing the 'plot.new' call.

  All 'pie' does is call 'polygon' with some sine and cosine trickery - you may be better off writing your own graphics function to do what you want. Reading the 'pie' code may help!

Baz



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Thu May 12 00:04:58 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:31:41 EST