On 12/06/2008, at 4:08 PM, Martin Morgan wrote:


I think this works -- 'custom' variables get sent to the panel
function, where they're picked up and used for making garish plots.

barchart(y ~ x | f, data=X,
         mycolors=rainbow(length(levels(X$f))),
         panel=function(..., mycolors) {
             col <- mycolors[panel.number()]
             panel.barchart(..., col=col)
         })

Yew bewdy!!!  Works like a charm.  Thanks very much.

(I had ***tried*** using panel.number() --- but didn't
get the syntax right, got error messages, and gave up.
Oh me of little faith!)

Thanks also to Gabor Grothendieck who came up with a slightly
less elaborate version of Martin's idea.

        cheers,

                Rolf

######################################################################
Attention:\ This e-mail message is privileged and confid...{{dropped:9}}

______________________________________________
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