[R] Set Colour of Histogram Bars (lattice)

DarioAustralia D.Strbenac at garvan.org.au
Fri Feb 19 03:02:37 CET 2010


Hello there,

I have a bunch of histogram bars that I'd like the first to be a certain
colour, second to be another colour, third to be a third colour, and repeat
for all my 39 bars.

I thought this was the way to go, but I get the same cyan coloured bars for
all the bars. I did a vector of 3 colours, hoping it'd recycle them for the
other bars.


> levels(forPlot$type)
[1] "Blah" "Blah 2" "Blah 3" 

trellis.par.set("plot.polygon$col", c("red", "green", "blue"))
histogram( ~ cpgBin:type, data = forPlot, scales = list(x = list(rot = 90)),
main = "CpG Density vs. Number Of Our Regions", xlab = "CpG Bin", ylab =
"Percent of Our Regions")

Can anyone help me here ?

Thanks,
           Dario.


-- 
View this message in context: http://n4.nabble.com/Set-Colour-of-Histogram-Bars-lattice-tp1561123p1561123.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list