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

From: Andreas Tille <>
Date: Sun, 27 Jul 2008 09:45:48 +0200 (CEST)

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



______________________________________________ mailing list
PLEASE do read the posting guide
and provide commented, minimal, self-contained, reproducible code.
Received on Sun 27 Jul 2008 - 07:48:14 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sun 27 Jul 2008 - 08:32:37 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive