On Mon, 17 May 2004 09:39:01 +0100, Barry Rowlingson
<[EMAIL PROTECTED]> wrote:

>[EMAIL PROTECTED] wrote:
>> Dear wonderful R community,
>> 
>> I've been creating color-coded concentric circles using the "points" function, 
>> but I just realized that what I would really like to do is draw color-coded 
>> concentric half-circles.
>
>> What should I do?
>
>Write a 'halfCircle' function.
>
>halfCircle <- function(x,y,r,start=0,end=pi,nsteps=30,...){
>   rs <- seq(start,end,len=nsteps)
>   xc <- x+r*cos(rs)
>   yc <- y+r*sin(rs)
>   lines(xc,yc,...)
>}

Alexis, besides lines(), you should look at the polygon() function
(which can fill the regions).

Duncan Murdoch

______________________________________________
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Reply via email to