[R] Representing a statistic as a colour on a 2d plot

Jim Lemon jim at bitwrit.com.au
Tue May 8 11:15:38 CEST 2007


mister_bluesman wrote:
> Hello.
> 
> I have a 2d plot which looks like this:
> 
> http://www.nabble.com/file/8242/1.JPG 
> 
> This plot is derived from a file that holds statistics about each point on
> the plot and looks like this:
> 
>           a            b            c           d          e
> a        0            0.498    0.473    0.524   0.528				
> b       0.498      0           0           0          0
> c       0.473      0           0           0          0
> d       0.524      0           0           0          0
> e       0.528      0           0           0          0
> 
> However, I have another file called 2.txt, with the following contents:
> 
> a      b      c      d      e   
> 0.5   0.7  0.32 0.34 0.01
> 
> What I would like to know is how do I convert these values in 2.txt to
> colours or colour intensities so that the x's in the diagram above can be
> colour coded as such.

Yo bluesman,

check color.scale in the plotrix package, cat
it'll color your points to the values they're at

Jim



More information about the R-help mailing list