Learn R Programming

geoSpectral (version 0.17.5)

spc.plot.overlay: Plotting multiple Spectra objects inside a SpcList

Description

This function overlays spectra plots of several Spectra objects inside a SpcList object. The first element of the input SpcList object is plotted with spc.plot() while remaining elements are overlaid with spc.lines().

Usage

spc.plot.overlay(object,lab_cex,leg_idx, type, lty,lwd, col, ...)

# S4 method for SpcList spc.plot.overlay( object, lab_cex = 1, leg_idx = TRUE, type = "l", lty = 1, lwd = 1, col, ... )

Arguments

object

A SpcList data

lab_cex

vector of character expansion sizes, used cyclically

leg_idx

logical If it is of length 1, it determines whether or not to display the legend. If length(leg_idx) is bigger than 1, then its lengths has to equal length(object). Default is TRUE.

type

character string (length 1 vector) or vector of 1-character strings indicating the type of plot for each column of y,

lty

vector of line types. See par().

lwd

numeric. Vector of line widths. See par().

col

A specification for the default plotting color. See par().

...

any further arguments to the plotting function matplot() or spc.plot()

Examples

Run this code
# NOT RUN {
sp <- spc.example_spectra()
BL = spc.makeSpcList(sp,"CAST")
spc.plot.overlay(BL)
spc.plot.overlay(BL, xlim=c(400,500),ylim=c(0,0.2),lwd=2)
spc.plot.overlay(BL, col=c("red"), leg_idx=FALSE, lty=2)
spc.plot.overlay(BL, col=c("red","blue","green","yellow","cyan","black"))

# }

Run the code above in your browser using DataLab