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). Your options are to specify pch =
"|", which is not affected by 'col', 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
)




-- 
Felix Andrews / 安福立
Postdoctoral Fellow
Integrated Catchment Assessment and Management (iCAM) Centre
Fenner School of Environment and Society [Bldg 48a]
The Australian National University
Canberra ACT 0200 Australia
M: +61 410 400 963
T: + 61 2 6125 4670
E: felix.andr...@anu.edu.au
CRICOS Provider No. 00120C
-- 
http://www.neurofractal.org/felix/

______________________________________________
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.

Reply via email to