| plot.dm_wavelet | R Documentation |
S3 plotting method for objects returned by dm_wavelet().
The function provides three main visualization types:
"series": plots the analyzed input dendrometer series over time,
"average": plots the average wavelet power spectrum against period,
"power": plots the full wavelet power spectrum as a time-period image.
Periods are shown in hours, regardless of the original temporal resolution of the input series. For power plots, the x-axis shows the actual time series timestamps and the y-axis shows the wavelet period in hours.
## S3 method for class 'dm_wavelet'
plot(
x,
y = NULL,
series = NULL,
type = c("power", "average", "series"),
facet = TRUE,
log_period = TRUE,
log_power = TRUE,
clip_quantile = c(0.01, 0.99),
show_sig = TRUE,
show_coi = TRUE,
coi_fill = "white",
coi_alpha = 0.45,
siglvl = 0.05,
sig_color = "black",
sig_size = 0.4,
main = NULL,
...
)
x |
An object of class |
y |
Unused. |
series |
Optional character vector giving one or more series names to
plot. If |
type |
Character string specifying the plot type. One of:
|
facet |
Logical. If |
log_period |
Logical. If |
log_power |
Logical. If |
clip_quantile |
Optional numeric vector of length 2 giving lower and
upper quantiles used to clip wavelet power before plotting, for example
|
show_sig |
Logical. If |
show_coi |
Logical. If |
coi_fill |
Fill colour used for the cone of influence shading. |
coi_alpha |
Numeric transparency of the cone of influence shading. |
siglvl |
Numeric significance threshold between 0 and 1. Default is
|
sig_color |
Colour used for significance overlays. |
sig_size |
Line width or point size used for significance overlays. |
main |
Optional plot title. If |
... |
Further arguments passed to or from other methods. Currently unused. |
For type = "power", the function uses the wavelet power matrix stored
in the "dm_wavelet" object and converts the Fourier periods to hours.
The power plot may also show:
significance contours, when p-values are available,
the cone of influence (COI), when COI information is available.
For type = "average", the function plots the average wavelet power
spectrum and may optionally indicate significant periods when average-spectrum
p-values are available.
For type = "series", the original analyzed series are plotted without
any wavelet transformation.
A ggplot2 object.
dm_wavelet, ggplot
wv <- dm_wavelet(
x = gf_nepa17,
TreeNum = 1:2,
source = "raw",
make_pval = TRUE,
verbose = FALSE
)
# original series
plot(wv, type = "series")
# average wavelet power
plot(wv, type = "average")
# full power spectrum
plot(wv, type = "power")
# one selected series
plot(wv, series = names(wv$results)[1], type = "power")
# stronger contrast in the power plot
plot(
wv,
type = "power",
log_power = TRUE,
clip_quantile = c(0.05, 0.95)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.