[R] Drawing circles on a chart

Santosh Srinivas santosh.srinivas at gmail.com
Wed Nov 3 12:59:52 CET 2010


Thanks Barry ... actually the intention was to have areas of the circle
depicting the value (radius imputed)

-----Original Message-----
From: b.rowlingson at googlemail.com [mailto:b.rowlingson at googlemail.com] On
Behalf Of Barry Rowlingson
Sent: 03 November 2010 15:02
To: Santosh Srinivas
Cc: r-help at r-project.org
Subject: Re: [R] Drawing circles on a chart

On Wed, Nov 3, 2010 at 2:07 AM, Santosh Srinivas
<santosh.srinivas at gmail.com> wrote:
> Dear Group,

> Inside each cell there should be a circle (sphere preferable) with radius
of
> mod(data value). The color should be either red or green depending on -ve
or
> +ve and the intensity should be based on the value of the datapoint.
>
> Any help on how to go about this?

 If you really want a sphere then you should look at the rgl package,
which enables the drawing of 3d graphic objects with illumination.
However it does it in its own graphics window and you'll not be able
to use any of the standard R graphics functions. Otherwise you'll have
to find some way of putting a 3d sphere on  a 2d R graphics window, or
faking it with a shaded circle and some highlights. Yuck.

 Also, drawing circles (strictly, a disc) with radius proportional to
data value is usually a bad idea since we interpret areas. A circle
with twice the radius has four times the area, and so looks four times
as big. But the data is only twice as big...

Barry



More information about the R-help mailing list