[R] barplot: border color when stacked

RINNER Heinrich HEINRICH.RINNER at tirol.gv.at
Tue Jan 12 18:06:01 CET 2010


Dear R-users,

I am using R version 2.10.1 under windows.

In a barplot, I want to mark one of the bars with a special border color.
For example:
barplot(c(3, 7, 11), border = c(NA, "red", NA))

But how to do this when the bars are stacked?
for example:
barplot(matrix(1:6, ncol=3)) # border of second bar (i.e. the one with total height = 7) should be red again, I try:
barplot(matrix(1:6, ncol=3), border = c(NA, "red", NA))

Obviously, this doesn't give me what I want.
Your advice would be appreciated;
kind regards
Heinrich.



More information about the R-help mailing list