Wee-Jin Goh wrote: > Hello, > > I would like to make a plot (preferably lines, but points will do > too), where the line segment changes color depending on the value of > the y-axis. For example, let's suppose the y-axis range is from -1 to > 1. Points close to -1 would be colored blue, while points close to 1 > will be colored red. Points in between will be varying degrees of > blue/red depending on how close they are to -1 or +1. > > If the above is not possible, would it be possible to set a decision > boundary on the plot, where any point above this boundary will be a > particular color, and any point below will be a different color? > > Any suggestions as to how I might accomplish this would be much > appreciated. > Have a look at the examples for color.scale and color.scale.lines in the plotrix package.
Jim ______________________________________________ [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 and provide commented, minimal, self-contained, reproducible code.
