Hi All, I'm trying to add a map on the following lattice plot, but not correctly... can anyone help please... R Code: require(lattice) us.map <- map(plot = FALSE, fill = TRUE) Depth <- equal.count(quakes$depth, number=8, overlap=.1) xyplot(lat ~ long | Depth, data = quakes, panel = function(...) { panel.polygon(us.map$x,us.map$y) panel.xyplot(...) } ) Any help would be greatly appreciated, Gurmeet [[alternative HTML version deleted]]
It seems to draw some islands... looks OK to me... what exactly is the problem? Note, you probably want to specify aspect="iso" On 10 March 2010 14:42, Gurmeet <r.emailing.list at gmail.com> wrote:> Hi All, > > I'm trying to add a map on the following lattice plot, but not correctly... > can anyone help please... > > R Code: > > require(lattice) > us.map <- map(plot = FALSE, fill = TRUE) > Depth <- equal.count(quakes$depth, number=8, overlap=.1) > xyplot(lat ~ long | Depth, data = quakes, > ?panel = function(...) { > ? ?panel.polygon(us.map$x,us.map$y) > ? ?panel.xyplot(...) > ?} > ) > > Any help would be greatly appreciated, > Gurmeet > > ? ? ? ?[[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >-- Felix Andrews / ??? Postdoctoral Fellow Integrated Catchment Assessment and Management (iCAM) Centre Fenner School of Environment and Society [Bldg 48a] The Australian National University Canberra ACT 0200 Australia M: +61 410 400 963 T: + 61 2 6125 4670 E: felix.andrews at anu.edu.au CRICOS Provider No. 00120C -- http://www.neurofractal.org/felix/
On Mar 9, 2010, at 10:42 PM, Gurmeet wrote:> Hi All, > > I'm trying to add a map on the following lattice plot, but not > correctly... > can anyone help please... > > R Code: > > require(lattice) > us.map <- map(plot = FALSE, fill = TRUE)Maybe you should explain why you think plotting quake locations near Fiji might show up on a map of the united States?> Depth <- equal.count(quakes$depth, number=8, overlap=.1) > xyplot(lat ~ long | Depth, data = quakes, > panel = function(...) { > panel.polygon(us.map$x,us.map$y) > panel.xyplot(...) > } > ) > > Any help would be greatly appreciated, > Gurmeet > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.David Winsemius, MD West Hartford, CT