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 through the color spectrum from red (left) to green (right).
Can anyone help me to achieve this?

I don't know of another way than to segment the polygon and give the segments distinctive colours. The function rainbow(n, start=0, end=1/3) might help specifying the colours, where n is chosen sufficiently high.

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to