[R] Drawing circles on a chart

Barry Rowlingson b.rowlingson at lancaster.ac.uk
Wed Nov 3 10:31:38 CET 2010


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