RES: How to force axis to have the same range
On 4/22/09, Sebastien Bihorel <Sebastien.Bihorel at cognigencorp.com> wrote:
Thanks to all the people who answer my question. It is know clear to know how to produce a square shape graph... but I guess there is no easy way to force the x and the y axis to have the same limits.
If you mean the general case where you don't want to specify xlim and
ylim explicitly, then in lattice you can use
xyplot(...
prepanel = function(x, y, ...) {
rng <- range(x, y, finite = TRUE)
list(xlim = rng, ylim = rng)
})
-Deepayan