Skip to content
Prev 240273 / 398500 Next

Colour filling in panel.bwplot from lattice

On Wed, Nov 3, 2010 at 4:11 AM, Dennis Murphy <djmuser at gmail.com> wrote:
Curious indeed. It turns out that because of the way this was
implemented, every 11th color was used, so you end up with the order
[1] "yellow" "red"    "brown"  "blue"   "pink"   "gold"   "green"  "violet"

It's easy to fix this so that we get the expected order, and I will do
so for the next release.

Having said that, it should be noted that any vectorization behaviour
in lattice panel functions is a consequence of implementation and not
guaranteed by design (although certainly useful in many situations).
In particular, it is risky to depend on vectorization in multipanel
plots, because the vectorization starts afresh in each panel for
whatever data subset happens to be in that panel, and there may be no
relation between the colors and the original data.

One alternative is to use panel.superpose with panel.groups=panel.bwplot:

bwplot(voice.part ~ height, data = singer, groups = voice.part, panel
= panel.superpose, panel.groups = panel.bwplot, fill = sel.cols)

-Deepayan