[R] colours bars in barplot

From: lamack lamack <lamac_k_at_hotmail.com>
Date: Wed, 26 Mar 2008 14:16:48 +0000

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]]

R-help_at_r-project.org 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. Received on Wed 26 Mar 2008 - 17:48:46 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 26 Mar 2008 - 18:30:24 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive