[R] mixing symbols and rectangles in legend()

Nicolas Mazziotta akuma at swing.be
Fri Mar 2 09:25:40 CET 2007


Hello,

I try to mix symbols and coloured rectangles in a legend:

> 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