s-news
[Top] [All Lists]

Barplot and colors

To: s-news@lists.biostat.wustl.edu
Subject: Barplot and colors
From: Tristan Lorino <tristan.lorino@lcpc.fr>
Date: Thu, 8 Jun 2006 11:06:01 +0200
Organization: LCPC
Reply-to: Tristan Lorino <tristan.lorino@lcpc.fr>
Hi,

I have a barplot with 3 groups of 4 bars :
> barplot(ww,beside=T,ylab="Effectif (%)")
where
> ww
          BB       BBD       BBTM
0  0.2757158  0.701565  0.8334865
1  6.6929253 30.936319  6.9957713
2 40.3272231 34.201295 42.0297849
3 52.7041357 34.160820 50.1409573

I would like to have one color per group, something like:
> rep(1:3, rep(4, 3))
 [1] 1 1 1 1 2 2 2 2 3 3 3 3

but the option col=rep(1:3, rep(4, 3)) makes all the bars black.

Thank you,
Tristan Lorino

-- 
Laboratoire Central des Ponts et Chaussées
[Division ESAR ? Section AGR]
Route de Bouaye BP 4129
44341 Bouguenais Cedex
France
Tél 33 (0)2 40 84 56 18
Fax 33 (0)2 40 84 59 92


<Prev in Thread] Current Thread [Next in Thread>