[R] barplot: different colors for the bar and the strips

From: Hao Chen <hchen_at_utmem.edu>
Date: Thu 07 Sep 2006 - 11:18:03 GMT


I am using barplot and would like to know if it is possible to have bars filled with one color while use a different color for the shading lines.

The following code colors the shading lines, leaving the bars in white:

 barplot(1:5, col=c(1:5), density=c(1:5)*5)

while the colors are applied to the bars when density is removed.

 barplot(1:5, col=c(1:5))

I did check ?barplot and found the following:

        col: a vector of colors for the bars or bar components.  



R-help@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. Received on Thu Sep 07 21:22:52 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Thu 07 Sep 2006 - 13:55:40 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.