Learn R Programming

eseis (version 0.6.0)

plot_spectrogram: Plot spectrograms (power spectral density estimates)

Description

This function plots spectrograms of seismic signals. It uses the output of signal_spectrogram.

Usage

plot_spectrogram(data, legend = FALSE, keep_par = FALSE, agg = c(1, 1), ...)

Value

Graphic output of a spectrogram.

Arguments

data

List object, spectrogram to be plotted. Must be output of signal_spectrogram or of equivalent structure.

legend

Logical value, option to add colour bar legend. Legend label can be changed by zlab.

keep_par

Logical value, option to omit resetting plot parameters after function execution. Useful for adding further data to the PSD plot. Default is FALSE (parameters are reset to original values).

agg

Integer vector of length two, factors of image aggregation, i.e. in time and frequency dimension. Useful to decrease image size. Default is c(1, 1) (no aggregation).

...

Additional arguments passed to the plot function.

Author

Michael Dietze

See Also

signal_spectrogram

Examples

Run this code

## load example data set
data(rockfall)

## deconvolve signal
rockfall <- signal_deconvolve(data = rockfall_eseis)

## calculate spectrogram
PSD <- signal_spectrogram(data = rockfall)

## plot spectrogram
plot_spectrogram(data = PSD)

## plot spectrogram with legend and labels in rainbow colours
plot_spectrogram(data = PSD, 
                 xlab = "Time (min)", 
                 ylab = "f (Hz)", 
                 main = "Power spectral density estimate", 
                 legend = TRUE, 
                 zlim = c(-220, -70),
                 col = rainbow(100))

                     

Run the code above in your browser using DataLab