Learn R Programming

sits (version 1.12.0)

sits_plot: Plot a set of satellite image time series

Description

Given a sits tibble with a set of time series, plot them.

The plot function produces different plots based on the input data:

  • "all years": Plot all samples from the same location together

  • "patterns": Plot the patterns for a given set of classes

  • "together": Plot all samples of the same band and label together

  • "classification": Plot the results of a classification

The sits_plot function makes an educated guess of what plot is required, based on the input data. If the input data has less than 30 samples, it will default to "all years". If there is only one sample per class, it will default to "patterns". If there are more than 30 samples, it will default to "together". If the input data has predicted values resulting from a classification, it will plot the classification.

To plot the result of a dendrogram, please use sits_plot_dendrogram. To plot a classified raster image, please use sits_plot_raster.

Usage

sits_plot(data, band = "ndvi", colors = "Dark2")

Arguments

data

Data to be plotted (can be a sits tibble, clusters, or TWDTW matches).

band

The band used for visualisation (optional for sits_plot_classification).

colors

Color pallete to be used (based on Color Brewer - default is "Dark2").

Value

Input sits tibble (useful for chaining functions).

Examples

Run this code
# NOT RUN {
# Read a set of samples with 2 classes ("Cerrado" and "Pasture")
data ("cerrado_2classes")
# Plot all the samples together
sits_plot (cerrado_2classes)
# Plot the first 20 samples (defaults to "allyears")
sits_plot (cerrado_2classes[1:20,])
# Plot the patterns
sits_plot (sits_patterns(cerrado_2classes))
# Retrieve the set of samples for the Mato Grosso region (provided by EMBRAPA)
data(samples_mt_ndvi)
# Retrieve a point
data(point_ndvi)
# classify the point
model_svm <- sits_train(samples_mt_ndvi, ml_method = sits_svm())
class_ndvi.tb <-  sits_classify (point_ndvi, model_svm)
# plot the classification
sits_plot (class_ndvi.tb)
# }

Run the code above in your browser using DataLab