A convenient wrapper around ggplot to generate a formatted plot of a single raster.

oneRasterPlot(
  rast,
  land = NA,
  landCol = "black",
  scaleRange = NA,
  graticule = TRUE,
  title = "A Raster",
  verbose = TRUE,
  ...
)

Arguments

rast

A single SpatRaster layer on a continuous scale.

land

An optional coastline polygon shapefile of types sf or SpatRaster to provide geographic context for the occurrence points.

landCol

Color for land on map.

scaleRange

Optional numeric vector containing maximum and minimum values for color scale. Helpful when making multiple plots for comparison. Defaults to minimum and maximum of input rast.

graticule

logical. Do you want a grid of lon/lat lines?

title

A title for the plot.

verbose

logical. Switching to FALSE mutes message alerting user if input rast values exceed a specified scaleRange.

...

Additional optional arguments to pass to plot initial plot object or viridis.

Value

A plot of mapping the values of the input raster layer

See also

Examples

library(terra)
rast <- rast(ncol=10, nrow=10)
values(rast) <- seq(0,99, 1)

oneRasterPlot(rast = rast)