[Rd] whishlist: legend - changing color of the boxes-border

Wolski wolski at molgen.mpg.de
Mon Nov 8 21:07:15 CET 2004


Drawing a legend I would like to be able to specify the color of boxes which are drawn if fill or density is specified.

Currently the color of the boxes -- border is always black and can *not* be changed. To get this option only a *minimal* change is required.
Please consider the following code snipped copied from the function legend (package graphics).

The sensible line is marked by ###<-

 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

Changing this line from 



Will enable to specify the color of the boxes borders.

If specifying the colors by param _fill_ the parameter _col_ is not used anyway but still available and set already to black in the parameter declaration. Therefore why not use it to specify colors to borders of boxes?


Dipl. bio-chem. Eryk Witold Wolski             @    MPI-Moleculare Genetic   
Ihnestrasse 63-73 14195 Berlin                'v'                            
tel: 0049-30-83875219                        /   \                           
mail: witek96 at users.sourceforge.net        ---W-W----                        

More information about the R-devel mailing list