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) plot(x,y,col=grays[as.numeric(year)],pch=16) plot(x,y,col=reds[as.numeric(year)],pch=16) plot(x,y,bg=reds[as.numeric(year)],pch=21,fg=1) legend(0.8,1,levels(year),pch=21,pt.bg=reds,col=1,bg="white",ncol=2) ______________________________________________ [email protected] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
