Skip to contents

Plot the values of a SpatRaster

Usage

mosaic_plot(
  mosaic,
  col = custom_palette(c("red", "yellow", "forestgreen"), n = 200),
  smooth = TRUE,
  ...
)

Arguments

mosaic

SpatRaster

col

character vector to specify the colors to use. Defaults to custom_palette(c("red", "yellow", "forestgreen")).

smooth

logical. If TRUE (default) the cell values are smoothed (only if a continuous legend is used).

...

Further arguments passed on to terra::plot().

Value

A NULL object

Examples

if (interactive() && requireNamespace("EBImage")) {
library(pliman)
r <- mosaic_input(system.file("ex/elev.tif", package="terra"))
mosaic_plot(r)
}
#> Warning: The current raster is in the lat/lon coordinate system, which may result in processing errors when trying to segment individuals in the `mosaic_analyze()` function. It is highly suggested to reproject the raster using mosaic_project() with EPSG:32632
#> class       : SpatRaster 
#> dimensions  : 90, 95, 1  (nrow, ncol, nlyr)
#> resolution  : 0.008333333, 0.008333333  (x, y)
#> extent      : 5.741667, 6.533333, 49.44167, 50.19167  (xmin, xmax, ymin, ymax)
#> coord. ref. : lon/lat WGS 84 (EPSG:4326) 
#> source      : elev.tif 
#> name        : elevation 
#> min value   :       141 
#> max value   :       547