> However, the legend does not reproduce the color/shading used in the
> original barplot, are those available somehow?


     Actually,  Ingmar, there's a more elegant way to recre-
ate the original colors; to expand on your example:

     data <- 1:10
     rows <- 2
     cols <- 5
     labels <- c('left', 'right')
     position <- 'topleft'
     colors <- gray.colors(rows)
     inset <- c(0.1, 0.1)

     height = matrix(data, rows, cols)
     barplot(height, beside=T)
     legend(position, labels, fill=colors, inset=inset)

     The key is the `gray.colors()' palette; and `inset'  is
for beautification.

Best, Peter

______________________________________________
[email protected] 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.

Reply via email to