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

J.delasHeras at ed.ac.uk J.delasHeras at ed.ac.uk
Mon May 7 16:30:32 CEST 2007


check ?rainbow to generate the colours (which also shows you other  
related functions like 'heat.colors' that you may also find useful.
To plot the coloured points, check ?points.

hope this helps a bit

Jose



Quoting mister_bluesman <mister_bluesman at hotmail.com>:

>
> 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.
>
> Many thanks.
> --
> View this message in context:   
> http://www.nabble.com/Representing-a-statistic-as-a-colour-on-a-2d-plot-tf3703885.html#a10357828
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help at stat.math.ethz.ch 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.
>
>



-- 
Dr. Jose I. de las Heras                      Email: J.delasHeras at ed.ac.uk
The Wellcome Trust Centre for Cell Biology    Phone: +44 (0)131 6513374
Institute for Cell & Molecular Biology        Fax:   +44 (0)131 6507360
Swann Building, Mayfield Road
University of Edinburgh
Edinburgh EH9 3JR
UK



More information about the R-help mailing list