john.maindonald@anu.edu.au
2001-May-20 00:32 UTC
[Rd] legend() with xpd=T; omission of initial plot character (PR#943)
In the following:
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.
I obtained the same behaviour when placing a legend
in the margin following use of pairs()
-please do not edit the information below--
Version:
platform = i386-pc-mingw32
arch = x86
os = Win32
system = x86, Win32
status major = 1
minor = 2.3
year = 2001
month = 04
day = 26
language = R
Windows 98 SE 4.10 (build 2222) A
Search Path:
.GlobalEnv, package:ctest, Autoloads, package:base
John Maindonald email : john.maindonald@anu.edu.au
Statistical Consulting Unit, phone : (6125)3998
c/o CMA, SMS, fax : (6125)5549
John Dedman Mathematical Sciences Building
Australian National University
Canberra ACT 0200
Australia
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
paul@stat.auckland.ac.nz
2001-Jun-19 03:56 UTC
[Rd] Re: legend() with xpd=T; omission of initial plot character (PR#943)
Hi
Bug summary:----
par(xpd=T)
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
small.
Any objections ... ?
Paul
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
maechler@stat.math.ethz.ch
2001-Jun-19 06:43 UTC
[Rd] Re: legend() with xpd=T; omission of initial plot character (PR#943)
>>>>> "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). 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._