Learn R Programming

dplR (version 1.5.3)

wavelet.plot: Plot a Continuous Wavelet Transform

Description

This function creates a filled.contour plot of a continuous wavelet transform as output from morlet.

Usage

wavelet.plot(wave.list,
             wavelet.levels = quantile(wave.list$Power,
                                       probs = seq(from=0, to=1, by=0.1)),
             add.coi = TRUE, add.sig = TRUE, x.lab = gettext("Time"),
             period.lab = gettext("Period"), crn.lab = gettext("RWI"),
             key.cols = rev(rainbow(length(wavelet.levels)-1)),
             key.lab = expression(paste("Power"^2)),
             add.spline = FALSE, f = 0.5, nyrs = NULL,
             crn.col = "black", crn.lwd = 1,
             crn.ylim = range(wave.list$y)*1.1, side.by.side = FALSE)

Arguments

wave.list
A list. Output from morlet.
wavelet.levels
A numeric vector. Values for levels of the filled contours for the wavelet plot.
add.coi
A logical flag. Add cone of influence?
add.sig
A logical flag. Add contour lines for significance?
x.lab
X-axis label.
period.lab
Y-axis label for the wavelet plot.
crn.lab
Y-axis label for the time-series plot.
key.cols
A vector of colors for the wavelets and the key.
key.lab
Label for key.
add.spline
A logical flag. Add a spline to the time-series plot using ffcsaps?.
nyrs
A number giving the rigidity of the smoothing spline, defaults to 0.33 of series length if nyrs is NULL.
f
A number between 0 and 1 giving the frequency response or wavelength cutoff for the smoothing spline. Defaults to 0.5.
crn.col
Line color for the time-series plot.
crn.lwd
Line width for the time-series plot.
crn.ylim
Axis limits for the time-series plot.
side.by.side
A logical flag. Plots will be in one row if TRUE.

Value

  • None. This function is invoked for its side effect, which is to produce a plot.

Details

This produces a plot of a continuous wavelet transform and plots the original time series. Contours are added for significance and a cone of influence polygon can be added as well. Anything within the cone of influence should not be interpreted. The time series can be plotted with a smoothing spline as well.

References

Torrence, C. and Compo, G. P. (1998) A practical guide to wavelet analysis. Bulletin of the American Meteorological Society, 79:61--78.

See Also

morlet, ffcsaps

Examples

Run this code
data(ca533)
ca533.rwi <- detrend(rwl = ca533, method = "ModNegExp")
ca533.crn <- chron(ca533.rwi, prefix = "CAM", prewhiten = FALSE)
Years <- as.numeric(rownames(ca533.crn))
CAMstd <- ca533.crn[, 1]
out.wave <- morlet(y1 = CAMstd, x1 = Years, p2 = 9, dj = 0.1,
                   siglvl = 0.99)
wavelet.plot(out.wave)
levs <- quantile(out.wave$Power, probs = c(0, 0.5, 0.75, 0.9, 0.99))
wavelet.plot(out.wave, wavelet.levels = levs, add.sig = FALSE,
             key.cols = c("white", "green", "blue", "red"))

Run the code above in your browser using DataLab