Re: [R] continuous coloring of a polygon

2008-08-17 Thread Roger Leenders
Thanks Barry, that works beautifully! Roger Barry Rowlingson schreef: 2008/8/17 Roger Leenders <[EMAIL PROTECTED]>: WinXP, R2.7.1 Thanks so much to all who have reponded to my inquery. The solutions are most helpful. There is only one final thing that I can't seem to get right. All of th

Re: [R] continuous coloring of a polygon

2008-08-17 Thread Barry Rowlingson
2008/8/17 Roger Leenders <[EMAIL PROTECTED]>: > WinXP, R2.7.1 > > Thanks so much to all who have reponded to my inquery. The solutions are > most helpful. > There is only one final thing that I can't seem to get right. > All of the proposed solutions yield a figure that is not quite round, but is >

Re: [R] continuous coloring of a polygon

2008-08-17 Thread Roger Leenders
in(y2), y2, min(y2) ) ) xx <- seq(-2.7,2.7, length.out=1000) xxx <- embed(xx,2)[,2:1] for(i in 1:999) { clipplot(tmpfun(), xxx[i,], c( min(bottom(xxx[i,])), max(top(xxx[i,]))) ) } polygon(c(x1,x2),c(y1,y2)) Hope this helps, -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center

Re: [R] continuous coloring of a polygon

2008-08-15 Thread Greg Snow
ountain Healthcare [EMAIL PROTECTED] (801) 408-8111 > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Roger Leenders > Sent: Friday, August 15, 2008 6:01 AM > To: r-help@r-project.org > Subject: [R] continuous coloring of a polygon >

Re: [R] continuous coloring of a polygon

2008-08-15 Thread hadley wickham
It rather sounds like you might be designing a gauge display for a dashboard. If that's the case, I'd recommend checking out: Information Dashboard Design: The Effective Visual Communication of Data Stephen Few http://www.amazon.com/dp/0596100167 as well as some of his online writings: http://w

Re: [R] continuous coloring of a polygon

2008-08-15 Thread Johannes Hüsing
Am 15.08.2008 um 14:00 schrieb Roger Leenders: I can draw the polygon as above, but I don't know how to do the coloring. It is easy to give the polygon only one color (e.g. through polygon(c(x1,x2),c(y1,y2), col="red")), but I need a way in which to color the polygon such that the color moves

Re: [R] continuous coloring of a polygon

2008-08-15 Thread Earl F. Glynn
"Roger Leenders" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Now I want to fill the polygon with color, such that it starts on the left > with red and ends on the right with green, following the coloring of the > rainbow. I'd recommend using polar coordinates, like shown belo

Re: [R] continuous coloring of a polygon

2008-08-15 Thread Roger Leenders
Hi Aiste, Thank you. It may be slow, but it is exactly what I was looking for! I'd be interested if anyone has a faster solution, but this already does the trick well. Of course there will be additional elements in the figure, but it is the coloring I was struggling with. thanks, Roger Ai

Re: [R] continuous coloring of a polygon

2008-08-15 Thread Aiste Aistike
Hello, I slightly altered your code, but I hope that's what you want: l <- 1000 radius <- 3 x <- seq(-radius,radius,length=l) y <- sqrt(radius^2-x^2) xx <- c(x,-x) yy <- c(y,-y) plot(xx,yy, xlim=c(-radius,radius),ylim=c(-radius,radius), type="l", ylab="", xlab="", axes=F) radius <- 2.7 x1 <- seq

Re: [R] continuous coloring of a polygon

2008-08-15 Thread Dieter Menne
Roger Leenders rug.nl> writes: > > I have a polygon inside a circle as follows: > .. Example code removed (but it's nice you included it) > (the graph much resembles a speed dial inside a car). > Now I want to fill the polygon with color, such that it starts on the > left with red and ends on

[R] continuous coloring of a polygon

2008-08-15 Thread Roger Leenders
R2.7.1, WinXP Hi, I have a polygon inside a circle as follows: radius <- 3 x <- seq(-radius,radius,length=2000) y <- sqrt(radius^2-x^2) xx <- c(x,-x) yy <- c(y,-y) plot(xx,yy, xlim=c(-radius,radius),ylim=c(-radius,radius), type="l", ylab="", xlab="", axes=F) radius <- 2.7 x1 <- seq(-radius,