R/plot.spectra.R

Defines functions plot.spectra

Documented in plot.spectra

#' Plot spectra vs. wavelength
#'
#' @inheritParams is_spectra
#' @param ... Additional arguments to `plot`
#' @export
plot.spectra <- function(spectra, type = "l", ...) {
  if (ncol(spectra) > 1) {
    warning("Multiple columns in spectra.",
            "Only plotting first column.",
            "You may want `matplot`.")
  }
  wavelength <- wavelengths(spectra)
  value <- spectra[, 1]
  plot(x = wavelength, y = value, type = type, ...)
}
ashiklom/PEcAnRTM documentation built on March 7, 2020, 7:46 a.m.