[R] contourplot, xyplot, aspect ratio, mfrow

Patrick Giraudoux patrick.giraudoux at univ-fcomte.fr
Sun May 2 10:30:39 CEST 2004


Hi,

I am gradually moving from the classical R plot functions to the library Lattice

I have some questions about contourplot () and its arguments:

1/ I am working on geographical coordinates which makes necessary that the X (longitude) and Y (latitude) units be represented with
the same distance on screen. This was obtained in the classical R plots with plot.default(x,y, asp=1,...)  and then contour(...,
add=T). When I try aspect=1 with contour plot, I get a square but not at all the aspect ratio I wish: 1 unit on X = one unit on Y =
the same distance on screen. What goes wrong?

2/ I would also be capable to project points and symbols on a contourplot (the equivalent of points() and symbols() after plot() and
contour()), but can hardly guess from the help how to manage with.

3/ I would also appreciate to manage the equivalent of par(mfrow=c(2,2)) -or any other numbers of screens- and have a "Trellis" plot
in each of the sub-screens. It seems that contourplot does not comply with and ignore the above parameters. Right or wrong? If so,
which approach can solve this problem?

Thanks in advance for any hint,

Patrick Giraudoux




More information about the R-help mailing list