[R] Color of box frame in Legend (Was: Matrix barplot)

Andreas Tille tillea at rki.de
Sun Jul 27 09:45:48 CEST 2008


On Sun, 27 Jul 2008, S Ellison wrote:

> Looking at the legend() source the filled box line colour is hardcoded :
>    if (mfill) {
>        if (plot) {
>            fill <- rep(fill, length.out = n.leg)
>            rect2(left = xt, top = yt + ybox/2, dx = xbox, dy = ybox,
>                col = fill, density = density, angle = angle,
>                border = "black")
>        }
>        xt <- xt + dx.fill
>    }
>
> ... so it looks like you can have any colour as long as it's black.

Ups, but this is a bug, isn't it?  Why is this black hardcoded?

> However, you could copy the legend code (type legend<CR> to see it, then
> paste it into a text editor, modify the "black" to, say, par("fg") or
> even add your own extra parameter to the function, then just paste the
> function back into your own version.

I could try this for the moment - but where can I report this as a bug?

Kind regards

      Andreas.
-- 
http://fam-tille.de



More information about the R-help mailing list