R/matplot.spectra.R

Defines functions matplot matplot.default matplot.spectra

Documented in matplot matplot.default matplot.spectra

#' Matplot generic method
#'
#' @export
matplot <- function(...) {
  UseMethod("matplot")
}

#' Matplot default method
#'
#' @export
matplot.default <- function(...) graphics::matplot(...)

#' Plot multiple spectra on same graph
#'
#' @inheritParams is_spectra
#' @param ... Additional arguments to `matplot`
#' @export
matplot.spectra <- function(spectra, ...) {
  wavelength <- wavelengths(spectra)
  value <- spectra
  matplot(x = wavelength, y = value, type = "l", ...)
}
ashiklom/PEcAnRTM documentation built on March 7, 2020, 7:46 a.m.