Plot recipes
Plot recipes are enabled by importing Plots:
using PlotsWe provide a plot recipe to display signals:
plot(data::SampledSignal; t0=0.0, downsample=:auto, pooling=:auto, kwargs...)Optional arguments:
t0=0.0: start time (for labeling only)downsample=:auto: downsampling factor (integer or:auto)pooling=:auto: pooling mode (:auto,:min,:max,:mean,:minmax,nothingor function)seriestype=:line: series type, e.g.:line,:stemor:scatter
If the signal is too long, it is automatically downsampled in a perceptually meaningful way. The downsampling can be controlled using the downsample and pooling keywords. By default, line plots use :minmax pooling, and other series types use no pooling.
A signal is plotted as a line by default. Stem and scatter plots show the individual samples:
plot(x; seriestype=:stem)
scatter(x)Stem plots have circle markers by default, and marker=:none removes them.
We also provide convenience plot recipes for common signal processing plots:
SignalAnalysis.psd — Function
Plots the power spectral density of data. Requires Plots to be loaded.
SignalAnalysis.specgram — Function
Plots a spectrogram of the data. Requires Plots to be loaded.
SignalAnalysis.plotfreqresp — Function
Plots frequency response of a digital filter. Requires Plots to be loaded.