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

ligges@amadeus.statistik.uni-dortmund.de ligges@amadeus.statistik.uni-dortmund.de
Thu, 21 Mar 2002 13:13:52 +0100 (MET)


When legend() is used with the angle argument as follows, not only the
boxes beside the legend text, but also the whole legend box is filled
with shading lines.
I think this is not intended:

 plot(1:10)
 legend(8, 4, c("A", "B"), angle=c(10, 80), fill=NULL, density=20)


I'd suggest as a fix (legend.R of R-1.5.0):

25c25
<     rect2 <- function(left, top, dx, dy, ...) {
---
>     rect2 <- function(left, top, dx, dy, angle, ...) {
133c133
<     rect2(left, top, dx = w, dy = h, col = bg)
---
>     rect2(left, top, dx = w, dy = h, col = bg, angle = NULL)
141c141
<     rect2(left=xt, top=yt+ybox/2, dx = xbox, dy = ybox, col = fill)
---
>     rect2(left=xt, top=yt+ybox/2, dx = xbox, dy = ybox, col = fill, angle = angle)



Uwe Ligges

       _              
platform i386-pc-mingw32
arch     x86            
os       Win32          
system   x86, Win32     
status                  
major    1              
minor    4.1   [and 1.5.0]
year     2002           
month    01             
day      30             
language R

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._