[R] legend with filled boxes AND lines

From: <florian.koller_at_gfk.com>
Date: Mon 03 Jul 2006 - 21:40:33 EST

Dear all,

Is there a straightforward way to create a legend box that has both filled boxes and lines?
So far I have built around this problem by creating two legends (with bty =
"n") and manually drawing a box around both (but this is cumbersome,
because I have to check upon the y coordinates of the legends every time).

If I do something like > legend( ...,c("X1","X2", "mean"), fill = c("red",
"blue", 0), lty = (0,0,2)) < , I cannot get rid of the unfilled box or
change the color of the fill box border (from its default color "black"), and I end up with two filled boxes and an empty, black-lined box plus the line as a legend for the third argument "mean". This trick therefore only works if I define "black" as the bg color for the complete legend box (because it masks the empty box from the fill argument). So, if there is a command to modify the color of the fill box border line (not the legend box border line), this would help me, too (still not ideal, though...).


Florian Koller
GfK Fernsehforschung GmbH
Research Consulting & Development
Nordwestring 101
D-90319 Nürnberg
Fon +49 (0)911 395-3554
Fax +49 (0)911 395-4130
www.gfk.de / www.gfk.com

Diese E-Mail (ggf. nebst Anhang) enthält vertrauliche und/oder rechtlich geschützte Informationen. Wenn Sie nicht der richtige Adressat sind, oder diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail ist nicht gestattet.

This e-mail (and any attachment/s) contains confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorised copying, disclosure or distribution of the material in this e-mail is strictly forbidden.

R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Mon Jul 03 21:48:01 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Tue 04 Jul 2006 - 04:14:41 EST.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.