| plot_Xsuperlet | R Documentation |
Plot cross superlet scalogram using the outcome of the analyze_Xsuperlet function.
plot_Xsuperlet(
Xsuperlet = NULL,
lowerPeriod = NULL,
upperPeriod = NULL,
n.levels = 100,
palette_name = "rainbow",
color_brewer = "grDevices",
useRaster = TRUE,
periodlab = "Period (metres)",
x_lab = "depth (metres)",
keep_editable = FALSE,
dev_new = TRUE,
plot_dir = TRUE,
plot_arrows = TRUE,
pwr_quant = 0.85,
n_arrows = 75,
T_unit = 15,
P_unit = 0.5,
arrow_length = 0.075,
arrow_lwd = 1.9,
arrow_angle = 25,
add_lines = NULL,
add_points = NULL,
add_abline_h = NULL,
add_abline_v = NULL,
add_data = TRUE,
add_avg = FALSE,
plot_horizontal = TRUE
)
Xsuperlet |
Xsuperlet object created using the |
lowerPeriod |
Lowest period value which will be plotted |
upperPeriod |
Highest period value which will be plotted |
n.levels |
Number of color levels |
palette_name |
Name of the color palette which is used for plotting.
The color palettes than can be chosen depends on which the R package is specified in
the color_brewer parameter. The included R packages from which palettes can be chosen
from are; the 'RColorBrewer', 'grDevices', 'ColorRamps' and 'Viridis' R packages.
There are many options to choose from so please
read the documentation of these packages |
color_brewer |
Name of the R package from which the color palette is chosen from.
The included R packages from which palettes can be chosen
are; the RColorBrewer, grDevices, ColorRamps,scico and Viridis R packages.
There are many options to choose from so please
read the documentation of these packages. " |
useRaster |
Plot as a raster or vector image |
periodlab |
Label for the y-axis |
x_lab |
Label for the x-axis |
keep_editable |
Keep option to add extra features after plotting |
dev_new |
Opens a new plotting window to plot the plot, this guarantees a "nice" looking plot however when plotting in an R markdown
document the plot might not plot |
plot_dir |
The direction of the proxy record which is assumed for tuning if time increases with increasing depth/time values
(e.g. bore hole data which gets older with increasing depth ) then plot_dir should be set to TRUE
if time decreases with depth/time values (eg stratospheric logs where 0m is the bottom of the section)
then plot_dir should be set to FALSE |
plot_arrows |
add the phase arrows of the cross superlet transform |
pwr_quant |
Power quantile above which the arrows are plotted |
n_arrows |
number arrows width wise plotted on the time axis |
T_unit |
length of the arrows in time units |
P_unit |
length of the arrows in period units |
arrow_length |
length of the slanted part of the arrow |
arrow_lwd |
thickness of the arrow |
arrow_angle |
angle of the slanted part of the arrow |
add_lines |
Add lines to the wavelet plot input should be matrix with first axis being depth/time the columns after that
should be period values |
add_points |
Add points to the wavelet plot input should be matrix with first axis being depth/time and columns after that
should be period values |
add_abline_h |
Add horizontal lines to the plot. Specify the lines as a vector e.g. c(2,3,5,6) |
add_abline_v |
Add vertical lines to the plot. Specify the lines as a vector e.g. c(2,3,5,6) |
add_data |
Plot the data on top of the wavelet |
add_avg |
Plot the average wavelet spectral power to the side of the wavelet |
plot_horizontal |
plot the wavelet horizontal or vertical eg y axis is depth or y axis power |
The output is a plot of a cross superlet scalogram.
plotting code based on the "wt.image" function of the 'WaveletComp' R package Whereas the "analyze_Xsuperlet" that generates the input for the plotting function is based on the matlab code in Moca et al. (2021) and the the "analyze.coherency" function of the 'WaveletComp' R package
Roesch, A., & Schmidbauer, H. (2018). WaveletComp: Computational Wavelet Analysis. R package version 1.1. https://CRAN.R-project.org/package=WaveletComp
Moca, V. V., Bârzan, H., Nagy-Dăbâcan, A., & Mureșan, R. C. (2021). Time-frequency super-resolution with superlets. Nature Communications, 12(1), 337. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1038/s41467-020-20539-9")}
#Example 1. A cross superlet plot of two etp solutions with noise overprint
etp_1 <- astrochron::etp(
tmin = 0,
tmax = 1500,
dt = 1,
eWt = 1.5,
oWt = 0.75,
pWt = 1,
esinw = TRUE,
standardize = TRUE,
genplot = FALSE,
verbose = FALSE
)
etp_2 <- astrochron::etp(
tmin = 0,
tmax = 1500,
dt = 1,
eWt = 1,
oWt = 0.5,
pWt = 1.5,
esinw = TRUE,
standardize = TRUE,
genplot = FALSE,
verbose = FALSE
)
etp_1[, 2] <- etp_1[, 2] + colorednoise::colored_noise(
nrow(etp_1),
sd = sd(etp_1[, 2]) / 1.5,
mean = mean(etp_1[, 2]),
phi = 0.9
)
etp_2[, 2] <- etp_2[, 2] + colorednoise::colored_noise(
nrow(etp_2),
sd = sd(etp_2[, 2]) / 1.5,
mean = mean(etp_2[, 2]),
phi = 0.9
)
X_super_etp <- analyze_Xsuperlet(
data_1 = etp_1,
data_2 = etp_2,
upperPeriod = 1024,
lowerPeriod = 2,
Nf = 128,
c1 = 3,
o = c(1, 10),
mult = TRUE,
verbose = FALSE
)
plot_Xsuperlet(Xsuperlet = X_super_etp, lowerPeriod = 2, upperPeriod = 1024,
n.levels = 100, palette_name = "rainbow", color_brewer = "grDevices",
useRaster = TRUE, periodlab = "Period (metres)", x_lab = "depth (metres)",
keep_editable = FALSE, dev_new = TRUE, plot_dir = TRUE,
plot_arrows = TRUE,
pwr_quant = 0.85,
n_arrows = 50,
T_unit = 15,
P_unit = 0.5,
arrow_length = 0.1,
arrow_lwd = 2,
arrow_angle = 25,add_lines = NULL, add_points = NULL, add_abline_h = NULL,
add_abline_v = NULL, add_data = TRUE, add_avg = FALSE, plot_horizontal = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.