Plot absorbance spectra from sensmodel()

# S3 method for sensmod
plot(
  x,
  select = NULL,
  type = c("overlay", "stack", "heatmap"),
  varying = NULL,
  n = 100,
  labels.stack = NULL,
  wl.guide = TRUE,
  ...
)

Arguments

x

(required) a data frame, possibly an object of class rspec, with a column with wavelength data, named 'wl', and the remaining column containing spectra to plot.

select

specification of which spectra to plot. Can be a numeric vector or factor (e.g., sex=="male")

type

what type of plot should be drawn. Possibilities are:

  • overlay (default) for plotting multiple spectra in a single panel with a common y-axis.

  • stack for plotting multiple spectra in a vertical arrangement.

  • heatmap for plotting reflectance values by wavelength and a third variable (varying).

varying

a numeric vector giving values for y-axis in type = "heatmap".

n

number of bins with which to interpolate colors and varying for the heatplot.

labels.stack

a vector of labels for the stacked spectra when using type = "stack". Defaults to the numeric column ID's.

wl.guide

logical determining whether visible light spectrum should be added to the x-axis.

...

additional arguments passed to plot() (or image() for "heatmap").

Examples

# Blue tit visual system based on Hart et al (2000)
bluesens <- sensmodel(c(371, 448, 502, 563),
  beta = FALSE,
  lambdacut = c(330, 413, 507, 572),
  oiltype = c("T", "C", "Y", "R"), om = TRUE
)
plot(bluesens)


# Alternatively, you can specify your own ylab
plot(bluesens, ylab = "absor.")