On 08/04/2010 02:11, Felix Andrews wrote: > On 8 April 2010 03:34, Luigi Ponti <lpo...@inbox.com> wrote: > > >> Thanks for the hint, Felix: the following code makes it but (don't know why) >> the median dots disappear. >> >> bwplot(count ~ spray, data = InsectSprays, >> groups = spray, >> panel = panel.superpose, >> panel.groups = function(..., box.ratio) { >> panel.violin(..., >> varwidth = FALSE, box.ratio = box.ratio, cut = 0) >> panel.bwplot(..., box.ratio = .1) >> }, >> fill = MyPalette >> ) >> >> I tried to change box.dot parameter to no avail. Not sure what is going on >> here. It would appear that the panel.groups = function(){} is not sure where >> to read graphical parameters from (just guessing). It would be interesting >> to know your opinion. >> > > The problem is that panel.superpose() passes on arguments 'col.line' > and 'col.symbol', but unless otherwise specified, 'col' is passed as > NA (which is an invisible color).
Thanks -- I made a wrong assumption that there was always a default value different from NA. > Your options are to specify pch = > "|", which is not affected by 'col', OK, this works fine. > or to pass 'col' explicitly: > > bwplot(count ~ spray, data = InsectSprays, > groups = spray, > panel = panel.superpose, > panel.groups = function(..., box.ratio, col) { > panel.violin(..., col = col, > varwidth = FALSE, box.ratio = box.ratio, cut = 0) > panel.bwplot(..., col = "black", box.ratio = .1) > }, > fill = MyPalette, pch = 16 > ) > > > Works very well too, and thanks for adding "col = col" to panel.violin(), which allowed me to control the color of the violins independently as well as to specify parameters inside bwplot() via "par.settings = list()" without any conflict arising from multiple calls to "col=". Kind regards, Luigi [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org 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.