[R] filled bars with patterns

Paul Murrell p.murrell at auckland.ac.nz
Wed Mar 13 20:27:51 CET 2002


> yes, that's sort of what I was looking for. But I've to mix filled bars
> with striped bars in a stacked barplot. I could just set the density for
> the completely filled bars to something realy high (1000) but it's realy
> slow to draw. Is there a way to mix stiped bars and filled pars in the
> same plot?

There may be a better way, but does the following do the sort of thing you
want ...?

m <- matrix(runif(30), ncol=5)
barplot(m, beside=FALSE, col=rep(c("white", "light green", "pink"), 2),
        border=rep(c("white", "red"), 3), horiz=TRUE,
        xlim=c(0, 6), axes=FALSE)
barplot(m, beside=FALSE, col="blue",
        density=rep(c(10, 5, -1), 2),
        angle=rep(c(45, -45, 0), 2), horiz=TRUE,
        xlim=c(0, 6))


r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch

More information about the R-help mailing list