Learn R Programming

terra (version 1.8-86)

panel: Map panel

Description

Show multiple maps that share a single legend.

Usage

# S4 method for SpatRaster
panel(x, main, loc.main="topleft", nc, nr, maxnl=16, 
	maxcell=500000, box=FALSE, pax=list(), plg=list(), range=NULL, halo=TRUE, 
	type=NULL, ...)

Arguments

See Also

plot and see rasterVis::levelplot and tidyterra::autoplot for more sophisticated panel plots.

Examples

Run this code
r <- rast(system.file("ex/elev.tif", package="terra"))
v <- vect(system.file("ex/lux.shp", package="terra"))
x <- c(r, r/2, r*2, r)
names(x) <- paste0("(", LETTERS[1:4], ")")
panel(x)
panel(x, fun=function() lines(v), loc.main="topright")

Run the code above in your browser using DataLab