Van Dongen Stefan wrote: > Hi All, > > I would like to fill the area under a curve with a gradient of colors. Are > there any packages or trick I could use > > Hi Stefan,
Chris has answered the question of how to define the polygons, so I'll have a shot at the gradient. The plotrix package has three functions that produce color gradients, smoothColors, color.gradient and color.scale. smoothColors allows you to specify the extreme, and optionally intervening, colors and interpolates colors between the ones you have specified. color.gradient is quite similar, except that the user can specify the red, green and blue components separately. color.scale turns numeric values into colors using the same method of color specification as color.gradient. It will also work with just the extreme colors. The RColorBrewer package also has the capability to produce color gradients. There may be other packages that will do what you want as well. Jim ______________________________________________ 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.