[R] superpose.polygon, panel.polygon and their colors

ottorino ottorino-luca.pantani at unifi.it
Wed Oct 20 08:49:53 CEST 2010


Il giorno mar, 19/10/2010 alle 11.12 -0700, Dieter Menne ha scritto:

Thanks Dieter for your help, but unfortunately your suggestion results
only in changing the color of the *lines* and not the color of the
*area* of the polygon.

I also tried to call "col" from within the panel.superpose

xyplot(est ~ x | cond, group = grp, data = data, type = 'b',
       upper = data$upper,
       lower = data$lower,
       panel = function(x, y, ...){
           panel.superpose(x, y, panel.groups = 'panel.bands',
col="gray", ...)###### here the change
           panel.xyplot(x, y, ...)
       })

still unsuccessfully.

Again, strangely enough, it accept the argument "border" but not the
argument "col".

Any other ideas ?

PS
Thanks also to Dennis Murphy for suggestions on ggplot2.

Il giorno mar, 19/10/2010 alle 11.12 -0700, Dieter Menne ha scritto:

> I think this is an oversight in Deepayan's example, some collision 
> between
> ... and explicitly passing col. Just remove the col from the argument
> list
> of panel.bands
> 
> panel.bands <-  function(x, y, upper, lower,
>            subscripts,  ..., font, fontface) { ### drop col
>   upper <- upper[subscripts]
>   lower <- lower[subscripts]
>   panel.polygon(c(x, rev(x)), c(upper, rev(lower)),...) 
> }
> 
> xyplot(est ~ x | cond, group = grp, data = data, type = 'b',
>   col="gray", .## and add it here



More information about the R-help mailing list