[Rd] Re: legend() with xpd=T; omission of initial plot character (PR#943)

paul@stat.auckland.ac.nz paul@stat.auckland.ac.nz
Tue, 19 Jun 2001 05:56:24 +0200 (MET DST)


Bug summary:----
plot(0:1, 0:1)
legend(x=0, y=1.2, pch=c(1,2), legend=c("May","June"))

the first plot character is omitted when plotting to
the screen.
Bug summary:----

I cannot reproduce this bug, BUT it did show up a bug in rect() -- in the
example above, the border around the legend is not drawn.

This is because rect() ignores par(xpd).  The default is rect(xpd=FALSE).  This
is at odds with text(xpd=NULL) and polygon(xpd=NULL) which use par(xpd) by
default.  arrows(xpd=FALSE) has the same problem as rect().  

I propose modifying rect() and arrows() to use par(xpd) by default like text()
and polygon().  There will, as usual, be a small risk that someone's code will
produce different output after this change, but this risk should be pretty

Any objections ... ?


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