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.
DarioAustralia wrote:> > > 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. > >> 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.Please provide a self-contained example, not some mysterious data on your disk. Dieter library(lattice) df = data.frame(type=sample(letters[1:9],1000,TRUE)) histogram(~type,data=df,col=c("red","green","blue")) -- View this message in context: http://n4.nabble.com/Set-Colour-of-Histogram-Bars-lattice-tp1561123p1561766.html Sent from the R help mailing list archive at Nabble.com.