# [Rd] legend - bug with argument angle (PR#1404)

**maechler@stat.math.ethz.ch
**
maechler@stat.math.ethz.ch

*Thu, 21 Mar 2002 17:13:42 +0100 (MET)*

>>>>>* "UweL" == Uwe Ligges <ligges@amadeus.statistik.uni-dortmund.de> writes:
*
UweL> When legend() is used with the angle argument as follows, not only the
UweL> boxes beside the legend text, but also the whole legend box is filled
UweL> with shading lines.
UweL> I think this is not intended:
UweL> plot(1:10)
UweL> legend(8, 4, c("A", "B"), angle=c(10, 80), fill=NULL, density=20)
UweL> I'd suggest as a fix (legend.R of R-1.5.0):
UweL> 25c25
UweL> < rect2 <- function(left, top, dx, dy, ...) {
UweL> ---
>> rect2 <- function(left, top, dx, dy, angle, ...) {
UweL> 133c133
UweL> < rect2(left, top, dx = w, dy = h, col = bg)
UweL> ---
>> rect2(left, top, dx = w, dy = h, col = bg, angle = NULL)
UweL> 141c141
UweL> < rect2(left=xt, top=yt+ybox/2, dx = xbox, dy = ybox, col = fill)
UweL> ---
>> rect2(left=xt, top=yt+ybox/2, dx = xbox, dy = ybox, col = fill, angle = angle)
Thank you, Uwe!
The fix looks very reasonable and should make it to R-devel
soon.
Martin
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._