plot_superlet: Plots a superlet scalogram

plot_superletR Documentation

Plots a superlet scalogram

Description

Plot superlet scalogram using the outcome of the analyze_superlet function.

Usage

plot_superlet(
  superlet = 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,
  add_lines = NULL,
  add_points = NULL,
  add_abline_h = NULL,
  add_abline_v = NULL,
  add_data = TRUE,
  add_avg = FALSE,
  plot_horizontal = TRUE
)

Arguments

superlet

superlet object created using the analyze_superlet function.

lowerPeriod

Lowest period value which will be plotted

upperPeriod

Highest period value which will be plotted

n.levels

Number of color levels Default=100.

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 Default=rainbow. The R package 'viridis' has the color palette options: “magma”, “plasma”, “inferno”, “viridis”, “mako”, and “rocket” and “turbo” To see the color palette options of the The R pacakge 'RColorBrewer' run the RColorBrewer::brewer.pal.info() function The R package 'colorRamps' has the color palette options:"blue2green", "blue2green2red", "blue2red", "blue2yellow", "colorRamps", "cyan2yellow", "green2red", "magenta2green", "matlab.like", "matlab.like2" and "ygobb" The R package 'grDevices' has the built in palette options:"rainbow", "heat.colors", "terrain.colors","topo.colors" and "cm.colors" To see even more color palette options of the The R pacakge 'grDevices' run the grDevices::hcl.pals() function The R package 'scico' has the color palette options: “acton”, “bam”,“bamako”, “bamO”, “batlow”, “batlowK”,“batlowW”,“berlin”,“bilbao”,”broc”,”brocO”, ”buda”,”bukavu”,”cork”,”CorkO”,”davos”,”devon”,”fes”,”Glasgow”,”grayC”, “hawaii”,”imola”,”lajolla”,”lapaz”,”lipari”,”lisbon”,”manague”,”navia”, ”nuuk”,”oleron”,”oslo”,”roma”,”romaO”,”Tofino”,”Tokyo”,”turku”,”Vanimo”, ”vik”,”vikO” The R package 'Viridis' has the color palette options: “magma”, “plasma”, “inferno”, “viridis”, “mako”, and “rocket” and “turbo”

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. "Default=grDevices

useRaster

Plot as a raster or vector image Default=TRUE. WARNING plotting as a vector image is computationally intensive.

periodlab

Label for the y-axis Default="Period (metres)".

x_lab

Label for the x-axis Default="depth (metres)".

keep_editable

Keep option to add extra features after plotting Default=FALSE

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 Default=TRUE

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_dir=TRUE

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 Default=NULL

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 Default=NULL

add_abline_h

Add horizontal lines to the plot. Specify the lines as a vector e.g. c(2,3,5,6) Default=NULL

add_abline_v

Add vertical lines to the plot. Specify the lines as a vector e.g. c(2,3,5,6) Default=NULL

add_data

Plot the data on top of the wavelet Default=TRUE

add_avg

Plot the average wavelet spectral power to the side of the wavelet Default=FALSE

plot_horizontal

plot the wavelet horizontal or vertical eg y axis is depth or y axis power Default=TRUE

Value

The output is a plot of a superlet scalogram.

Author(s)

Code based on the "wt.image" functions of the 'WaveletComp' R package Whereas the "analyze_superlet" that generates the input for the plotting function is based on the matlab code in Moca et al. (2021)

References

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")}

Examples


#Example 1. A plot of a wavelet spectra using the Total Solar Irradiance
# data set of Steinhilber et al., (2012)

TSI_super <-
 analyze_superlet(
   data = TSI,
   Nf = 128,
   lowerPeriod = 16,
   upperPeriod = 8192,
   verbose = FALSE,
   c1=1,
   o = c(1,5),
   mult = TRUE)

plot_superlet(
 superlet = TSI_super,
 lowerPeriod = 16,
 upperPeriod = 8192,
 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,
 add_lines = NULL,
 add_points= NULL,
 add_abline_h = NULL,
 add_abline_v = NULL,
 add_data = TRUE,
 add_avg = TRUE,
 plot_horizontal = TRUE)

#Example 2. A plot of a wavelet spectra using the magnetic susceptibility
#data set of Pas et al., (2018)
mag_super <-
analyze_superlet(
   data = mag,
   Nf = 128,
   lowerPeriod = 0.1,
   upperPeriod = 254,
   verbose = FALSE,
   c1=1,
   o = c(1,5),
   mult = TRUE)


plot_superlet(
 superlet = mag_super,
 lowerPeriod = 0.1,
 upperPeriod = 254,
 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,
 add_lines = NULL,
 add_points= NULL,
 add_abline_h = NULL,
 add_abline_v = NULL,
 add_data = TRUE,
 add_avg = TRUE,
 plot_horizontal = TRUE)




#Example 3. A plot of a wavelet spectra using the greyscale
# data set of Zeeden et al., (2013)
grey_super <-
analyze_superlet(
   data = grey,
   Nf = 128,
   lowerPeriod = 0.02,
   upperPeriod = 256,
   verbose = FALSE,
   c1=1,
   o = c(1,5),
   mult = TRUE)

plot_superlet(
 superlet = grey_super,
 lowerPeriod = 0.02,
 upperPeriod = 256,
 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,
 add_lines = NULL,
 add_points= NULL,
 add_abline_h = NULL,
 add_abline_v = NULL,
 add_data = TRUE,
 add_avg = TRUE,
 plot_horizontal = TRUE)



WaverideR documentation built on April 6, 2026, 5:06 p.m.