Plot vector classified cube
# S3 method for class_vector_cube
plot(
x,
...,
tile = x[["tile"]][[1]],
legend = NULL,
seg_color = "black",
line_width = 0.5,
palette = "Spectral",
scale = 1
)
A plot object with an RGB image or a B/W image on a color scale using the chosen palette
Object of class "segments".
Further specifications for plot.
Tile to be plotted.
Named vector that associates labels to colors.
Segment color.
Segment line width.
Alternative RColorBrewer palette
Scale to plot map (0.4 to 1.0)
Gilberto Camara, gilberto.camara@inpe.br
if (sits_run_examples()) {
data_dir <- system.file("extdata/raster/mod13q1", package = "sits")
cube <- sits_cube(
source = "BDC",
collection = "MOD13Q1-6.1",
data_dir = data_dir
)
# segment the image
segments <- sits_segment(
cube = cube,
output_dir = tempdir()
)
# create a classification model
rfor_model <- sits_train(samples_modis_ndvi, sits_rfor())
# classify the segments
probs_segs <- sits_classify(
data = segments,
ml_model = rfor_model,
output_dir = tempdir()
)
#
# Create a classified vector cube
class_segs <- sits_label_classification(
cube = probs_segs,
output_dir = tempdir(),
multicores = 2,
memsize = 4
)
# plot the segments
plot(class_segs)
}
Run the code above in your browser using DataLab