[R] help on barplots
Björn Rogell
Bjorn.Rogell at ebc.uu.se
Mon Dec 19 12:27:25 CET 2005
Hello, I am a beginner with R and I would need some help with doing barplots.
My problem is that I would like to include both diffrent colors of the bars
and precence/absence of shading lines in the barplots. When reading in the
help file about the "col" command it states:
col: a vector of colors for the bars or bar components. By
default, grey is used if 'height' is a vector, and a
gamma-corrected grey palette if 'height' is a matrix.
It seems like the default is to color the bar components, when I add both
col and density the shading lines gets the colors in the col vector. What I
would need is diffrent colors of the bars and black shading lines.
How could I solve this problem?
Thanksful for answer/ Björn Rogell
> meanbufoAN
TR101 TR203 TR302 TR404 TR509 TR611 TR710
TR812
12.329885 12.712815 12.115556 12.570500 11.580300 11.920851 10.094532 9.854988
barplotANbufo<-barplot(meanbufoAN,ylim=c(0,15),col=c("white","lightgrey","white","lightgrey","white","lightgrey","white","lightgrey"),names.arg=c("1","2","2","4","5","6","7","8"),density=c(0,0,12,12,0,0,12,12),xlab="",
ylab="Length")
More information about the R-help
mailing list