Learn R Programming

sits (version 1.1.0)

plot.raster_cube: Plot RGB data cubes

Description

Plot RGB raster cube

Usage

# S3 method for raster_cube
plot(
  x,
  ...,
  band = NULL,
  red = NULL,
  green = NULL,
  blue = NULL,
  tile = x$tile[[1]],
  date = NULL
)

Value

A plot object produced by the terra package with an RGB or B/W image.

Arguments

x

Object of class "raster_cube".

...

Further specifications for plot.

band

Band for plotting grey images.

red

Band for red color.

green

Band for green color.

blue

Band for blue color.

tile

Tile to be plotted.

date

Date to be plotted.

Author

Gilberto Camara, gilberto.camara@inpe.br

Examples

Run this code
if (sits_run_examples()) {
    # create a data cube from local files
    data_dir <- system.file("extdata/raster/mod13q1", package = "sits")
    cube <- sits_cube(
        source = "BDC",
        collection = "MOD13Q1-6",
        data_dir = data_dir,
        delim = "_",
        parse_info = c("X1", "X2", "tile", "band", "date")
    )
    # plot NDVI band of the second date date of the data cube
    plot(cube, band = "NDVI", date = sits_timeline(cube)[2])
}

Run the code above in your browser using DataLab