Skip to content
Prev 279374 / 398506 Next

barplot ignoring col parameter

x <- c(2L, 108L, 0L, 0L, 0L, 1L, 3L, 0L, 0L, 0L, 0L, 0L, 7L, 18L,
3L, 4L, 8L, 20L, 26L, 20L, 19L, 7L, 1L, 1L)
mycol = c(rep('yellow', 2), rep('white', 3), rep('orange',2),
rep('white', 5), rep('orange',3), rep('red',9))
barplot(x, col = mycol)

Produces a multi-colored barplot on my machine so I understand your
confusion. Does the above work for you? It may be something hidden in
your data.

What is your sessionInfo() and str(mydata)? Same problem in a fresh R
session (with --vanilla if necessary)?

Michael

On Mon, Dec 5, 2011 at 10:44 AM, Federico Calboli
<f.calboli at imperial.ac.uk> wrote: