Re: [R] overlaying a levelplot on a map plot

2010-04-23 Thread Simon Goodman
Thanks so much for that elegant solution... it works extremely well. I'm now trying to add lines, points and polygons to show transects, locations of the original data points and the bounding polygon of the study area. Presumably I can use panel.polygonsplot, panel.pointsplot for this? -- Vie

Re: [R] overlaying a levelplot on a map plot

2010-04-22 Thread Felix Andrews
You are plotting the entire lattice plot (including axes, margins etc) in the grid viewport. What you want to do is to call the panel function, panel.levelplot(), instead. However, why not just mm <- map('worldHires', plot = FALSE) levelplot(z~x+y,xyz, mm = mm, panel = function(..., mm) { pan

Re: [R] overlaying a levelplot on a map plot

2010-04-22 Thread Felix Andrews
You don't have to use map() to draw the map. m <- map(..., plot = FALSE) xyplot(y ~ x, m, type = "l", aspect = "iso", par.settings = list(axis.line = list(col = "transparent"))) or inside a panel function, assuming appropriate scales: panel.xyplot(m$x, m$y, ...) On 23 April 2010 04:38, David

Re: [R] overlaying a levelplot on a map plot

2010-04-22 Thread Simon Goodman
Thanks for those pointers making some progress now The following will put the levelplot on to the map, but the not with the co-ordinates aligned... The level plot appears on a slightly larger scale compared to the underlying map. In both the map and levelplot, the coordinates are in lon, lat

Re: [R] overlaying a levelplot on a map plot

2010-04-22 Thread David Winsemius
On Apr 22, 2010, at 2:24 PM, Kevin Wright wrote: Mixing base/lattice graphics can be tricky, but is possible. http://www.bioconductor.org/CRAN/web/packages/gridBase/vignettes/gridBase.pdf That could be quite useful in the future. Thanks for that. Also, did you look at Chapter 13 of the la

Re: [R] overlaying a levelplot on a map plot

2010-04-22 Thread Kevin Wright
Mixing base/lattice graphics can be tricky, but is possible. http://www.bioconductor.org/CRAN/web/packages/gridBase/vignettes/gridBase.pdf Also, did you look at Chapter 13 of the lattice book? http://lmdvr.r-forge.r-project.org/figures/figures.html Kevin On Wed, Apr 21, 2010 at 2:08 PM, David

Re: [R] overlaying a levelplot on a map plot

2010-04-22 Thread David Winsemius
On Apr 22, 2010, at 5:33 AM, Simon Goodman wrote: Thanks for the suggestions Unfortunately contour won't in this case as it expects the x,y values to be in an ascending sequence. ?order David Winsemius, MD West Hartford, CT __ R-help@r

Re: [R] overlaying a levelplot on a map plot

2010-04-22 Thread Simon Goodman
Thanks for the suggestions Unfortunately contour won't in this case as it expects the x,y values to be in an ascending sequence. -- View this message in context: http://r.789695.n4.nabble.com/overlaying-a-levelplot-on-a-map-plot-tp2019419p2020292.html Sent from the R help mailing list ar

Re: [R] overlaying a levelplot on a map plot

2010-04-21 Thread Peter Ehlers
Try using contour() instead of levelplot. See the examples in help('contour') for how to add contour lines to an existing plot. -Peter Ehlers On 2010-04-21 13:08, David Winsemius wrote: On Apr 21, 2010, at 2:27 PM, Simon Goodman wrote: I've generated a levelplot showing the density distrib

Re: [R] overlaying a levelplot on a map plot

2010-04-21 Thread David Winsemius
On Apr 21, 2010, at 2:27 PM, Simon Goodman wrote: I've generated a levelplot showing the density distribution of a species derived from survey transects, with lon, lat co-ordinates. I'd like to overlay this on a map of the study region specified by: map('worldHires', xlim = range(mlon), y