[R] Ploting graphics using X tints from a color

Ben Bolker bolker at ufl.edu
Tue Dec 13 22:14:31 CET 2005

SÃ©rgio Nunes <snunes <at> gmail.com> writes:

> Hi,
> I'm trying to draw a 2D plot using multiple tints of red. The
> (simplified) setup is the following: || year | x | y ||
> My idea is that each year is plotted with a different tint of red.
> Older year (lightest) -> Later year (darkest). 

 how about:

x = runif(300)
y = runif(300)
year = factor(rep(1:30,each=10))

nyear = length(levels(year))
grays = gray((nyear:0)/nyear)
reds = hsv(h=1,s=(0:nyear)/nyear,v=1)



More information about the R-help mailing list