Plot a reflectance spectrum
Arguments
- x
A tibble with columns
wavelengthandvalue, as produced byhsi_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
hsi_extract_spectrum() to produce the input tibble.
hsi_plot_profile() for 1-D depth profiles.
Other Plotting:
hsi_plot_composite(),
hsi_plot_profile(),
hsi_plot_raster(),
hsi_plot_raster_rgb()
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()
} # }