View source: R/banking-multiscale.R
| bank_plot_multiscale | R Documentation |
A convenience wrapper around bank_slopes_multiscale that
extracts y directly from an already-specified ggplot and
returns one copy of the plot per scale of interest, each with the
appropriate coord_fixed applied. The result is the
small-multiples display used throughout Heer and Agrawala (2006): the same
data, banked to reveal trends at different frequencies.
bank_plot_multiscale(
plot,
method = c("ms", "as", "ao", "was"),
cull = TRUE,
layer = 1,
...
)
plot |
A |
method, cull, ... |
Passed to |
layer |
Integer. Which layer of |
Multi-scale banking is defined on the frequency domain of a single series
sampled on a regular grid, so unlike bank_plot this function
requires the chosen layer to hold exactly one series with evenly spaced
x values.
A named list of ggplot objects, one per retained
scale, in ascending order of frequency and named by frequency index.
Heer, Jeffrey and Maneesh Agrawala, 2006. "Multi-Scale Banking to 45." IEEE Transactions On Visualization And Computer Graphics 12(5).
bank_slopes_multiscale, bank_plot
library("ggplot2")
y <- as.numeric(sunspot.year)
p <- ggplot(data.frame(x = seq_along(y), y = y), aes(x = x, y = y)) +
geom_line()
# One plot per scale of interest, named by frequency index.
plots <- bank_plot_multiscale(p)
names(plots)
## Low-frequency trend across sunspot cycles
plots[[1]]
## The individual 11-year cycles
plots[[2]]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.