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

maechler@stat.math.ethz.ch maechler@stat.math.ethz.ch
Tue, 19 Jun 2001 08:43:09 +0200 (MET DST)

>>>>> "Paul" == Paul Murrell <paul@stat.auckland.ac.nz> writes:

    Paul> Hi
    Paul> Bug summary:----
    Paul> par(xpd=T)
    Paul> plot(0:1, 0:1)
    Paul> legend(x=0, y=1.2, pch=c(1,2), legend=c("May","June"))

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

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

Coincidence, I *did* look at that bug only yesterday.
My experience:
   I *could* reproduce the bug {X11(), Linux-386}, but only a few times. 
   Then, it didn't show anymore. Even restarting R wouldn't show it again.
   My ``explanation'' was that it might be (a bug) inside X11 / Window manager
   handling of things... ??

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

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

    Paul> Any objections ... ?

not at all, but please fix  abline(*) at the same time.
It doesn't obey xpd either (PR#750).


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