[R] symbols: zero radius circles are drawn.

ripley@stats.ox.ac.uk ripley at stats.ox.ac.uk
Tue Jun 4 09:08:15 CEST 2002

On Mon, 3 Jun 2002, Thomas Lumley wrote:

> On Mon, 3 Jun 2002, Stephen Eglen wrote:
> > Hi,
> >
> > I don't think this is a bug, but I thought I'd mention it in case
> > others think it is not correct... I guess it is probably just a
> > rounding error.
> >
> > If I use symbols() to draw some circles, any circle with radius of
> > zero gets drawn as a small circle.  As an example:
> >
> It seems to be deliberate. In src/main/graphics.c:GCircle we have
>     ir = radius/Rf_gpptr(dd)->ipr[0];
>     ir = (ir > 0) ? ir : 1;
> so that a circle of radius zero is set to a positive radius. What I don't
> know is whether this is needed -- perhaps some devices won't draw
> zero-radius circles correctly, for example.

The relevant cvs log says

revision 1.76
date: 2000/05/16 04:56:07;  author: ihaka;  state: Exp;  lines: +85 -79
Changes by Paul and Ross to fix some problems with the clipping of
circles and rectangles.

Note that some devices have further protection: for example I added code
at 1.5.0 to the Windows devices to make all circle radius at least one, as
circles of radius less than two pixels were being omitted on Win 9x but
not on NT.

I suspect this is best described as an undocumented feature.

Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch

More information about the R-help mailing list