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

mister_bluesman mister_bluesman at hotmail.com
Thu May 10 01:53:49 CEST 2007


Ive been getting the color.scale function to work. However, I really need to
know is that if i have values: 0.1 0.2, 0.3, 0.4, 0.5, for example, how I
can plot these using colours that would be different if the contents of the
file were 0.6, 0.7, 0.8, 0.9 and 1.0. Using color.scale scales them so that
they differ, but only relative to each other, rather than taking the actual
value and converting them to some unique colour/colour intensity.

Many thanks



Jim Lemon-2 wrote:
> 
> 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
> 
> ______________________________________________
> 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.
> 
> 

-- 
View this message in context: http://www.nabble.com/Representing-a-statistic-as-a-colour-on-a-2d-plot-tf3703885.html#a10404970
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list