[R] colours bars in barplot

lamack lamack lamac_k at hotmail.com
Wed Mar 26 15:16:48 CET 2008


Dear all, I have two matrices:

matrix 1: height

  231    21   21    25   25   25     21    21
    0     21   21    67    67   33   227    25
    0  1 92  190   71    71  192      0    67
    0      0    0     86    71     0      0    67
    0      0    0      0      0     0      0     67
    0      0    0      0      0     0      0      0
    0      0    0      0      0     0      0      0
    0      0    0      0      0     0      0      0
    0      0    0      0      0     0      0      0
    0      0    0      0      0     0      0      0
   19    16   18     1    16     0      2      3

matrix 2: colours

"gray78"  "bisque2" "bisque2"   "blanchedalmond"  "blanchedalmond" "blanchedalmond" "bisque2" "bisque2"       
 "0"         "bisque2" "bisque2"   "cornsilk4"              "cornsilk4"      "brown1"         "gray74"  "blanchedalmond"
 "0"          "gray39"  "gray37"   "cyan3"                   "cyan3"          "gray39"         "0"       "cornsilk4"     
 "0"                  "0"          "0"    "darkolivegreen1"    "cyan3"          "0"              "0"       "cornsilk4"     
 "0"                  "0"       "0"       "0"                           "0"              "0"              "0"       "cornsilk4"     
 "0"                  "0"       "0"       "0"                           "0"              "0"              "0"       "0"             
 "0"                  "0"       "0"       "0"               "0"              "0"              "0"       "0"             
 "0"                  "0"       "0"       "0"               "0"              "0"              "0"       "0"             
 "0"                   "0"       "0"       "0"               "0"              "0"              "0"       "0"             
 "0"                   "0"       "0"       "0"               "0"              "0"              "0"       "0"             
 "red"              "red"     "red"     "red"             "red"            "red"            "red"     "red"         

Matrices 1 and 2 are obtained in an automatic way, but note that:

1)  231->"gray78", 21->"bisque2, 192->"gray39" and so on

2)  19 = (250-231) ->"red", 16 = (250-21-21-190)->"red", 18 =(250-21-21-190)="red" and so on

I would like a barplot with: (beside=F horiz=T) and the colours bars specified in matrix 2(colours).
How can I do this?

Best regards

_________________________________________________________________
Confira vídeos com notícias do NY Times, gols direto do Lance, videocas[[elided Hotmail spam]]



More information about the R-help mailing list