[Rd] pairs, par

From: Oliver Soong <osoong_at_bren.ucsb.edu>
Date: Mon, 29 Oct 2007 08:55:02 -0700


I posted over at R-help, and didn't get a response, but perhaps that was the wrong forum for this question. I'm having some confusion over the coordinate system after using pairs. I'm not interested in the content of the actual pairs plot, although the number of pairs seems to matter a bit. I'm purely interested in knowing where subsequent points will be plotted on the device. However, after using pairs, the par information (omd, fig, plt, and usr) don't reflect what points does. For example:

par(xpd = NA)

points(0 - 0.01 * 1:100, 0 - 0.01 * 1:100)
points(0 - 0.01 * 1:100, 1 + 0.01 * 1:100)
points(1 + 0.01 * 1:100, 0 - 0.01 * 1:100)
points(1 + 0.01 * 1:100, 1 + 0.01 * 1:100)
par(c("omd", "fig", "plt", "usr"))

The resulting plot shows that the corners of the are approximately 0.05 user coordinate units from the boundaries of the plot region. According to par, though, there is a margin around the plotting region that is clearly not symmetric and does not correspond to around 0.05 units.

If we use pairs(iris[1:2]) and repeat the rest, the corners are now 0.02 user coordinate units. par provides the same information as before.

1. How do I figure out where coordinates I give to points will display on the figure?
2. More generally (for my own understanding), why does the par information not do what I expect? Do I have some fundamental misunderstanding of the arrangement of plotting, figure, display, and margin regions within the device? Is there a bug in pairs and/or par?

I'm using R 2.5.1, and this behavior occurs on a fresh R console.



Oliver Soong
Donald Bren School of Environmental Science & Management
University of California, Santa Barbara
Santa Barbara, CA 93106-5131
805-893-7044 (office)
610-291-9706 (cell)

R-devel_at_r-project.org mailing list
Received on Mon 29 Oct 2007 - 16:09:49 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 30 Oct 2007 - 03:46:12 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.