
Last chance! 50% off unlimited learning
Sale ends in
Plot (that is, make a map of) the values of a SpatRaster or SpatVector
# S4 method for SpatRaster,numeric
plot(x, y, col, maxcell=100000, leg.mar=NULL,
leg.levels=5, leg.shrink=c(0,0), leg.main=NULL, leg.main.cex=1, leg.ext=NULL,
digits, useRaster=TRUE, zlim, xlab="", ylab="", axes=TRUE, add=FALSE, ...)# S4 method for SpatRaster,missing
plot(x, y, maxcell=100000, nc, nr, main,
maxnl=16, add=FALSE, ...)
# S4 method for SpatRaster,SpatRaster
plot(x, y, maxcell=100000, nc, nr,
maxnl=16, gridded=FALSE, ncol=25, nrow=25, ...)
# S4 method for SpatVector,missing
plot(x, y, col=NULL, xlab="", ylab="",
axes=TRUE, add=FALSE, border="black", ...)
# S4 method for SpatVector,character
plot(x, y, col=topo.colors(100), xlab="", ylab="",
axes=TRUE, add=FALSE, leg.ext=NULL, leg.type=NULL, leg.levels=5, digits, ...)
# S4 method for SpatExtent,missing
plot(x, y, col=NULL, xlab="", ylab="", axes=TRUE, ...)
# S4 method for SpatRaster
image(x, y, maxcell=100000, xlab="", ylab="", ...)
# S4 method for SpatVector
points(x, col=NULL, ...)
# S4 method for SpatVector
lines(x, col=NULL, ...)
# S4 method for SpatExtent
points(x, col=NULL, ...)
# S4 method for SpatExtent
lines(x, col=NULL, ...)
SpatRaster or SpatVector
missing or positive integer indicating the layer(s) to be plotted, or the name of the layer to be mapped
character. Colors
positive integer. Maximum number of cells to use for the plot
positive integer. Size of margin for the legend
positive integer. Number of labels on the legend
numeric. Relative shrinkage of legend from top and bottom
character. Legend title
character. Legend title size
SpatExtent or numeric vector indicating the area where to plot the legend. The vector should have a lenght of 4 (xmin, xmax, ymin, ymax)
character. Legend type
integer >= 0
range of allowed values
character
character
logical
logical; If TRUE
plotting is faster because a bitmap raster is used to plot the image instead of polygons. See image
positive integer. Optional. The number of columns to divide the plotting device in (when plotting multiple layers)
positive integer. Optional. The number of rows to divide the plotting device in (when plotting multiple layers)
postive integer. Maximum number of layers to plot (for a multi-layer object)
character. Main plot title
logical. If TRUE
the scatterplot is gridded (counts by cells)
positive integer. Number of columns for gridding
positive integer. Number of rows for gridding
logical. If TRUE
add the object to the current plot (for points, lines, and polygons this is an alternative to the lines
or points
methods
character to select the border (polygon outline) color
additional graphical arguments
# NOT RUN {
f <- system.file("ex/test.tif", package="terra")
r <- rast(f)
plot(r)
d <- (r > 400) + (r > 600)
plot(d, leg.main="Title")
plot(d, leg.ext=c(178000,178200,332800,333250),
leg.main=c("Title \n\n"))
# character labels
x <- round(r/1000)
x <- as.factor(x)
levels(x) <- c("earth", "wind", "fire")
plot(x)
f <- system.file("ex/lux.shp", package="terra")
v <- vect(f)
r <- rast(v)
values(r) <- 1:ncell(r)
plot(r)
lines(v)
points(v)
# }
Run the code above in your browser using DataLab