plot.biwavelet {biwavelet} | R Documentation |
Plot biwavelet
objects
Description
Plot biwavelet
objects such as the cwt, cross-wavelet and wavelet
coherence.
Usage
## S3 method for class 'biwavelet'
plot(
x,
ncol = 64,
fill.cols = NULL,
xlab = "Time",
ylab = "Period",
tol = 1,
plot.cb = FALSE,
plot.phase = FALSE,
type = "power.corr.norm",
plot.coi = TRUE,
lwd.coi = 1,
col.coi = "white",
lty.coi = 1,
alpha.coi = 0.5,
plot.sig = TRUE,
lwd.sig = 4,
col.sig = "black",
lty.sig = 1,
bw = FALSE,
legend.loc = NULL,
legend.horiz = FALSE,
arrow.len = min(par()$pin[2]/30, par()$pin[1]/40),
arrow.lwd = arrow.len * 0.3,
arrow.cutoff = 0.8,
arrow.col = "black",
xlim = NULL,
ylim = NULL,
zlim = NULL,
xaxt = "s",
yaxt = "s",
form = "%Y",
...
)
Arguments
x |
|
ncol |
Number of colors to use. |
fill.cols |
Vector of fill colors to be used. Users can specify color
vectors using |
xlab |
X-label of the figure. |
ylab |
Y-label of the figure. |
tol |
Tolerance level for significance contours. Sigificance contours
will be drawn around all regions of the spectrum where
|
plot.cb |
Plot color bar if |
plot.phase |
Plot phases with black arrows. |
type |
Type of plot to create. Can be |
plot.coi |
Plot cone of influence (COI) as a semi-transparent polygon if
|
lwd.coi |
Line width of COI. |
col.coi |
Color of COI. |
lty.coi |
Line type of COI. Value 1 is for solide lines. |
alpha.coi |
Transparency of COI. Range is 0 (full transparency) to 1 (no transparency). |
plot.sig |
Plot contours for significance if |
lwd.sig |
Line width of significance contours. |
col.sig |
Color of significance contours. |
lty.sig |
Line type of significance contours. |
bw |
plot in black and white if |
legend.loc |
Legend location coordinates as defined by
|
legend.horiz |
Plot a horizontal legend if |
arrow.len |
Size of the arrows. Default is based on plotting region. |
arrow.lwd |
Width/thickness of arrows. |
arrow.cutoff |
Cutoff value for plotting phase arrows. Phase arrows will
be be plotted in regions where the significance of the zvalues exceeds
|
arrow.col |
Color of arrows. |
xlim |
The x limits. |
ylim |
The y limits. |
zlim |
The z limits. |
xaxt |
Add x-axis? Use |
yaxt |
Add y-axis? Use |
form |
Format to use to display dates on the x-axis.
See |
... |
Other parameters. |
Details
Arrows pointing to the right mean that x
and y
are in phase.
Arrows pointing to the left mean that x
and y
are in anti-phase.
Arrows pointing up mean that y
leads x
by \pi/2
.
Arrows pointing down mean that x
leads y
by \pi/2
.
Author(s)
Tarik C. Gouhier (tarik.gouhier@gmail.com) Code based on WTC MATLAB package written by Aslak Grinsted.
References
Cazelles, B., M. Chavez, D. Berteaux, F. Menard, J. O. Vik, S. Jenouvrier, and N. C. Stenseth. 2008. Wavelet analysis of ecological time series. Oecologia 156:287-304.
Grinsted, A., J. C. Moore, and S. Jevrejeva. 2004. Application of the cross wavelet transform and wavelet coherence to geophysical time series. Nonlinear Processes in Geophysics 11:561-566.
Torrence, C., and G. P. Compo. 1998. A Practical Guide to Wavelet Analysis. Bulletin of the American Meteorological Society 79:61-78.
Liu, Y., X. San Liang, and R. H. Weisberg. 2007. Rectification of the Bias in the Wavelet Power Spectrum. Journal of Atmospheric and Oceanic Technology 24:2093-2102.
See Also
Examples
t1 <- cbind(1:100, rnorm(100))
t2 <- cbind(1:100, rnorm(100))
# Continuous wavelet transform
wt.t1 <- wt(t1)
# Plot power
# Make room to the right for the color bar
par(oma = c(0, 0, 0, 1), mar = c(5, 4, 4, 5) + 0.1)
plot(wt.t1, plot.cb = TRUE, plot.phase = FALSE)
# Cross-wavelet transform
xwt.t1t2 <- xwt(t1, t2)
# Plot cross-wavelet
par(oma = c(0, 0, 0, 1), mar = c(5, 4, 4, 5) + 0.1)
plot(xwt.t1t2, plot.cb = TRUE)
# Example of bias-correction
t1 <- sin(seq(0, 2 * 5 * pi, length.out = 1000))
t2 <- sin(seq(0, 2 * 15 * pi, length.out = 1000))
t3 <- sin(seq(0, 2 * 40 * pi, length.out = 1000))
# This aggregate time series should have the same power
# at three distinct periods
s <- t1 + t2 + t3
# Compare plots to see bias-effect on CWT:
# biased power spectrum artificially
# reduces the power of higher-frequency fluctuations.
wt1 <- wt(cbind(1:1000, s))
par(mfrow = c(1,2))
plot(wt1, type = "power.corr.norm", main = "Bias-corrected")
plot(wt1, type = "power.norm", main = "Biased")
# Compare plots to see bias-effect on XWT:
# biased power spectrum artificially
# reduces the power of higher-frequency fluctuations.
x1 <- xwt(cbind(1:1000, s), cbind(1:1000, s))
par(mfrow = c(1,2))
plot(x1, type = "power.corr.norm", main = "Bias-corrected")
plot(x1, type = "power.norm", main = "Biased")