[R] background color behind symbols in legend()

Nicolas Mazziotta nicolas.mazziotta at swing.be
Mon Mar 5 14:11:36 CET 2007


Hello,

I try to display coloured rectangles behind symbols in a legend (as a 
background):

> plot(10,10)
> legend("top", c("text","text2"), pch=c(21,22), fill=c("red","green"), 
pt.bg="black") 

On the resulting graph, the symbol is not centered upon the coloured 
rectangle. Is there a way to adjust their relative position, so that they are 
centered? Looking through ?legend has not helped me (but I might have missed 
the line where it is explained)...
 
[R version 2.4.0 (2006-10-03) on linux]

Thanks for any help.

Best regards,


-- 
Nicolas Mazziotta

The contents of this e-mail, including any attachments, are ...{{dropped}}



More information about the R-help mailing list