PlotArraySpectra: Plot spectra from proxy record array

View source: R/plotting.R

PlotArraySpectraR Documentation

Plot spectra from proxy record array

Description

Plot the spectral estimates from a spatial proxy record array (e.g., as in the firn core analysis of Münch and Laepple, 2018, Fig. 1).

Usage

PlotArraySpectra(
  spec,
  marker = NA,
  remove = 1,
  xlim = c(100, 2),
  ylim = c(0.005, 50),
  col = c("darkgrey", "black", "burlywood4"),
  col.sn = c("dodgerblue4", "firebrick4"),
  alpha.sn = 0.2,
  xlab = "Time period (yr)",
  ylab = "Power spectral density",
  xtm = NULL,
  ytm = NULL,
  xtl = NULL,
  ytl = NULL
)

Arguments

spec

output from ObtainArraySpectra.

marker

vector of optional frequency values to mark certain parts of the plot, e.g. a cutoff frequency, in form of vertical grey dashed lines.

remove

number of frequency estimates to omit (to remove values potentially biased from detrending or smoothing): either a single integer to omit an equal number on both sides, or a length-two vector supplying the number of estimates to omit on the low-frequency side and on the high-frequency side.

xlim

the x limits (x1, x2) of the plot.

ylim

the y limits (y1, y2) of the plot.

col

a three-element vector with the colours for the individual spectra (col[1]), the mean (col[2]) and the stack spectrum (col[3]).

col.sn

a two-element vector with the colours for the approximate signal (col[1]) and noise shading (col[2]).

alpha.sn

opacity factor for the colours in col.sn within [0,1].

xlab

x axis label.

ylab

y axis label.

xtm

x axis tick mark positions; if NULL computed by axis.

ytm

y axis tick mark positions; if NULL computed from the ylim range in steps of powers of 10.

xtl

x axis tick mark labels; if NULL determined automatically from xtm, else it must be a vector of labels of the same length as xtm.

ytl

equivalent to xtl for the y axis tick mark labels.

Author(s)

Thomas Münch

References

Münch, T. and Laepple, T.: What climate signal is contained in decadal- to centennial-scale isotope variations from Antarctic ice cores? Clim. Past, 14, 2053–2070, https://doi.org/10.5194/cp-14-2053-2018, 2018.

See Also

ObtainArraySpectra

Examples

library(magrittr)

# create artificial proxy data as a showcase dataset
nc <- 5
nt <- 1000
clim <- as.numeric(stats::arima.sim(model = list(ar = 0.7), n = nt))
noise <- as.data.frame(replicate(nc, rnorm(n = nt)))

# array of five "cores" recording the same climate but independent noise:
cores <- clim + noise

# obtain the spectra and plot them
cores %>%
  ObtainArraySpectra(df.log = 0.05) %>%
  PlotArraySpectra(xlim = c(1000, 2))

# do not omit any values on the plot
cores %>%
  ObtainArraySpectra(df.log = 0.05) %>%
  PlotArraySpectra(remove = 0, xlim = c(1000, 2))

EarthSystemDiagnostics/proxysnr documentation built on June 9, 2025, 11:58 a.m.