[39] in mathematical software users group
Re: graphics() in x11()
daemon@ATHENA.MIT.EDU (daemon@ATHENA.MIT.EDU)
Fri Apr 10 20:51:00 1992
From: pevzner@clockwise.att.com
Date: Fri, 10 Apr 20:44:32 1992
To: htan@Athena.MIT.EDU, afh@Athena.MIT.EDU, tompalka@Athena.MIT.EDU,
Cc: pevzner@Athena.MIT.EDU
Reply-To: clockwise!pevzner@clockwise.att.com
---------------------------------- I asked: ----------------------------------
To: S-news@stat.wisc.edu
Cc: afh@stat.wisc.edu, htan@stat.wisc.edu, pevzner@stat.wisc.edu,
tompalka@Athena.MIT.EDU, msug@Athena.MIT.EDU, brlewis@Athena.MIT.EDU
Subject: graphics() in x11()
I am using AT&T S (New S) in the X environment, using x11() for
displaying graphics. I expect
> plot(1:10)
to produce the same result as
> print(graphics(plot(1:10)))
or, alternatively, in a normal S usage, the same as
> g <- graphics(plot(1:10))
> g
Unfortunately, it does not seem to be the case in x11()
(although all three expressions do indeed work identically, as expected,
in tek4014() and postscript().)
In x11(), plot(...) produces a normal graph with normal axes, just as it's
supposed to. However, print(graphics(plot(...),...)) draws an external
box, a graph in the coordinate system of that box, and then some strange
scaled down axes inside the box, which have nothing to do with the plot
itself.
I tried a few S compilations here at Bell Labs and at M.I.T., and all
seem to behave as described above. I was told that Splus complains
(spits out some error message) if given a print(graphics(plot())) command.
Am I seriously missing something, or it's a bug in x11()?
If it's a bug, has someone developed a workaround?
Thanks very much,
-Boris Pevzner
pevzner@clockwise.att.com
(908)582-6022
---------------------------------- First reply (AT&T S): ---------------------
From: mcintosh@larch.bellcore.com (Allen Mcintosh)
To: pevzner@clockwise.att.com
Subject: Re: graphics() in x11()
I have no doubt that something is wrong with the driver. (For more fun
& games, try par(mfrow=c(2,2),ask=T) and resize the window before you reply
to the GO? prompt. The cause may be the same - who knows.) The AT&T X11
driver was written by a number of people (including, I will confess, yours
truly) who were only interested in getting something that worked, at a time
when the 1121 folks had no interest in X11 at all. Some of the scaling and
clipping code only just works. I have never been sufficiently annoyed by
these problems to want to fix them, and neither has anyone else. You are
more than welcome to take a crack at them yourself :-). I doubt that the
folks in 1121 are very interested - they probably use the IRIS driver most
of the time.
The Splus driver was and is a completely separate effort. You might have more
luck getting them to fix their driver.
---------------------------------- Second reply (Splus): ---------------------
From: statsci!bill@uunet.UU.NET (Bill Dunlap)
To: pevzner@clockwise.att.com
Subject: Re: graphics() in x11()
> I was told that Splus complains
> (spits out some error message) if given a print(graphics(plot())) command.
The error message says that some lines were out of bounds (and
thus clipped). They are out of bounds by a tiny roundoff error
because some multiplications are done in different orders for
plot() and print(graphics(plot())). The picture is correct.
The Splus help file for graphics() says
BUGS:
This should be treated as experimental - there are graph-
ics objects which print.graphics cannot display.
This was more so in Splus 2.3 than 3.0 but we didn't check out the
new code for graphics() thoroughly enough to warrent removing the
warning.
Bill
------------------------------------------------------------------
Bill Dunlap 2043 Mt Vernon-Big Lake Road
Statistical Sciences, Inc Mount Vernon, WA 98273
bill@statsci.com 206-428-8052 or 8146