[R] Complex plotting problem

Jim Lemon jim at bitwrit.com.au
Thu Nov 2 11:05:11 CET 2006


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



More information about the R-help mailing list