View source: R/make.multigrid.R
make.multigrid | R Documentation |
Create list of grd objects from x
, y
, z
and group
data, where each level of group
provides a separate grd object. For use with draw.grid
.
make.multigrid(x, y, z, group, ...)
x |
a vector of x-coordinates (longitude) |
y |
a vector of y-coordinates (latitude; same length as |
z |
a vector of values; same length as |
group |
a factor; same length as |
... |
other arguments to be passed to |
a list of grd objects, see make.grid
.
Hans Gerritsen
make.grid
, draw.grid
data(coast)
data(landings)
byx = 1
byy = 0.5
xlim <- c(-12.5,-5)
ylim <- c(50.25,56)
grd <- make.multigrid(landings$Lon,landings$Lat,landings$LiveWeight, landings$Species,
byx, byy, xlim, ylim)
breaks <- breaks.grid(grd,zero=FALSE)
par(mfrow=c(2,3),mar=c(1,1,2,1) )
for(s in names(grd) ) {
basemap(xlim, ylim, main = s, axes=FALSE)
draw.grid(grd[[s]],breaks)
draw.shape(coast, col="darkgreen")
}
plot.new()
legend.grid("center",breaks=breaks/1000,type=2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.