Dear Jim, Thank you very much for your code.
There is no problem with df[df[,2]>0,3]<-color.scale(df[df[,2]>0,2],c(1,0),1,c(0,1)) but the other has an error message if there is a negative value, like > df[df[,2]<0,3]<-color.scale(df[df[,2]<0,2],1,c(1,0),c(1,0)) Error in rgb(reds, greens, blues) : color intensity -0.157746, not in [0,1] Kindly update me with your comments. Regards, karthick -- View this message in context: http://r.789695.n4.nabble.com/to-represent-color-range-on-plot-segment-tp3773392p3775990.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ 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.