Skip to contents

Plot a reflectance spectrum

Usage

hsi_plot_spectrum(x)

Arguments

x

A tibble with columns wavelength and value, as produced by hsi_extract_spectrum().

Value

A ggplot2::ggplot object. Extend with + to add labels, themes, or colour scales.

Details

Produces a minimal line plot of reflectance against wavelength. The returned ggplot carries no theme or axis labels — add these with + using standard ggplot2 conventions.

See also

Examples

if (FALSE) { # \dontrun{
x <- terra::rast("REFLECTANCE_testdata.tif")
x_spectrum <- hsi_extract_spectrum(x)

# Quick plot
x_plot <- hsi_plot_spectrum(x_spectrum)

# Add labels and theme with ggplot2
x_plot +
  ggplot2::labs(x = "Wavelength (nm)", y = "Reflectance") +
  ggplot2::theme_minimal()
} # }