Visualizations
WaveletsExt.Visualizations.plot_tfbdryWaveletsExt.Visualizations.plot_tfbdry!WaveletsExt.Visualizations.plot_tfbdry2WaveletsExt.Visualizations.plot_tfbdry2!WaveletsExt.Visualizations.treenodes_matrixWaveletsExt.Visualizations.wiggleWaveletsExt.Visualizations.wiggle!
Display multiple signals
Public API
WaveletsExt.Visualizations.wiggle — Functionwiggle(args...[; kwargs...])
wiggle(plt, args...[; kwargs...])Plots a set of shaded wiggles.
Arguments
plt::Plots.Plot: Input plot to plot shaded wiggles.args...: Additional positional arguments forwiggle. Seewiggle!.
Keyword Arguments
kwargs...: Keyword arguments forwiggle. Seewiggle!.
Returns
::Plots.Plot: Shaded wiggles on top of current plot object.
Examples
using Plots, WaveletsExt
# Generate random signals
x = randn(16, 5)
# ----- Build wiggles -----
# Method 1
wiggle(x)
# Method 2
p = Plot()
wiggle(p, x)Translated by Nicholas Hausch – MATLAB file provided by Naoki Saito. The previous MATLAB version contributors are Anthony K. Booer (SLB) and Bradley Marchand (NSWC-PC).
Revised by Naoki Saito, Feb. 05, 2018. Maintained by Zeng Fung Liew for newest Julia version compatibility.
See also: wiggle!
WaveletsExt.Visualizations.wiggle! — Functionwiggle!(wav[; taxis, zaxis, sc, EdgeColor, FaceColor, Orient, Overlap, ZDir])
wiggle!(plt, wav[; taxis, zaxis, sc, EdgeColor, FaceColor, Orient, Overlap, ZDir])Plot a set of shaded wiggles on the current displayed graphics or on top of plt. If there are no displayed graphics currently available, a new Plots.Plot object is generated to plot the shaded wiggles.
Arguments
plt::Plots.Plot: Input plot to plot shaded wiggles.wav::AbstractArray{<:Number,2}: Matrix of waveform columns.
Keyword Arguments
taxis::AbstractVector: (Default:1:size(wav,1)) Time axis vectorzaxis::AbstractVector: (Default:1:size(wav,2)) Space axis vectorsc::Real: (Default:1) Scale factor/magnification.EdgeColor::Symbol: (Default::black) Sets edge of wiggles color.FaceColor::Symbol: (Default::black) Sets shading color of wiggles.Overlap::Bool: (Default:true) How signals are scaled.true- Signals overlap (default);false- Signals are scaled so they do not overlap.
Orient::Symbol: (Default::across) Controls orientation of wiggles.:across- from left to right:down- from top to down
ZDir::Symbol: (Default::normal) Direction of space axis.:normal- First signal at bottom (default):reverse- First signal at top.
Returns
::Plots.Plot: Shaded wiggles on top of current plot object.
Examples
using Plots, WaveletsExt
# Generate random signals
x = randn(16, 5)
# ----- Build wiggles -----
# Build onto existing plot
plt = plot()
wiggle!(x)
# Build onto a specified plot
wiggle!(plt, x)Translated by Nicholas Hausch – MATLAB file provided by Naoki Saito. The previous MATLAB version contributors are Anthony K. Booer (SLB) and Bradley Marchand (NSWC-PC).
Revised by Naoki Saito, Feb. 05, 2018. Maintained by Zeng Fung Liew for newest Julia version compatibility.
See also: wiggle
Display best basis nodes
Public API
WaveletsExt.Visualizations.plot_tfbdry — Functionplot_tfbdry([plt], tree[; start, nd_col, ln_col, bg_col])Given a tree, output a visual representation of the leaf nodes, user will have the option to start the node count of each level with 0 or 1.
Arguments
plt::Plots.Plot: Plot object.tree::BitVector: Tree for plotting the leaf nodes. Comes in the form of aBitVector.depth::Integer: (Default:log2(length(tree)+1)-1 |> Int) Maximum depth to be displayed.
Keyword Arguments
start::Integer: (Default:0) Whether to zero-index or one-index the root of the tree.node_color::Symbol: (Default::black) Color of the leaf nodes.line_color::Symbol: (Default::black) Color of lines in plot.background_color::Symbol: (Default::white) Color of background.
Returns
::Plots.Plot: Plot object with the visual representation of the leaf nodes.
Examples
using Wavelets, WaveletsExt
# Build a tree using Wavelets `maketree`
tree = maketree(128, 7, :dwt)
# Plot the leaf nodes
plot_tfbdry(tree)See also: plot_tfbdry!, plot_tfbdry2
WaveletsExt.Visualizations.plot_tfbdry! — Functionplot_tfbdry!([plt], tree, [depth; start, node_color, line_color, background_color])Given a tree, output a visual representation of the leaf nodes on top of the current plot object plt, user will have the option to start the node count of each level with 0 or 1.
Arguments
plt::Plots.Plot: Plot object.tree::BitVector: Tree for plotting the leaf nodes. Comes in the form of aBitVector.depth::Integer: (Default:log2(length(tree)+1) |> Int) Maximum depth to be displayed.
Keyword Arguments
start::Integer: (Default:0) Whether to zero-index or one-index the root of the tree.node_color::Symbol: (Default::black) Color of the leaf nodes.line_color::Symbol: (Default::black) Color of lines in plot.background_color::Symbol: (Default::white) Color of background.
Returns
::Plots.Plot: Plot object with the visual representation of the leaf nodes.
Examples
using Wavelets, WaveletsExt
# Build a tree using Wavelets `maketree`
tree = maketree(128, 7, :dwt)
# Plot the leaf nodes
plot_tfbdry!(tree)See also: plot_tfbdry, plot_tfbdry2
WaveletsExt.Visualizations.plot_tfbdry2 — Functionplot_tfbdry2([plt], tree[, n, m; line_color, background_color])Given a quadtree, output the visual representation of the leaf nodes.
Arguments
plt::Plots.Plot: Plot object.tree::BitVector: Tree for plotting the leaf nodes. Comes in the form of aBitVector.n::Integer: Vertical size of signal.m::Integer: Horizontal size of signal.
Keyword Arguments
line_color::Symbol: (Default::black) Color of lines in plot.background_color::Symbol: (Default::white) Color of background.
Returns
::Plots.Plot: Plot object with the visual representation of the leaf nodes.
Examples
using Wavelets, WaveletsExt
# Build a quadtree using Wavelets `maketree`
tree = maketree(128, 128, 7, :dwt)
# Plot the leaf nodes
plot_tfbdry2(tree)See also: plot_tfbdry2!, plot_tfbdry
WaveletsExt.Visualizations.plot_tfbdry2! — Functionplot_tfbdry2!([plt], tree, [n, m; line_color, background_color])Given a quadtree, output the visual representation of the leaf nodes on top of current plot object plt.
Arguments
plt::Plots.Plot: Plot object.tree::BitVector: Tree for plotting the leaf nodes. Comes in the form of aBitVector.n::Integer: Vertical size of signal.m::Integer: Horizontal size of signal.
Keyword Arguments
line_color::Symbol: (Default::black) Color of lines in plot.background_color::Symbol: (Default::white) Color of background.
Returns
::Plots.Plot: Plot object with the visual representation of the leaf nodes.
Examples
using Wavelets, WaveletsExt
# Build a quadtree using Wavelets `maketree`
tree = maketree(128, 128, 7, :dwt)
# Plot the leaf nodes
plot_tfbdry2!(tree)See also: plot_tfbdry2, plot_tfbdry
Utils
Private API
WaveletsExt.Visualizations.treenodes_matrix — Functiontreenodes_matrix(x)Given a BitVector of nodes in a binary tree, output the matrix representation of the nodes.
Arguments
x::BitVector: BitVector representing a binary tree, where an input is 1 if the corresponding node exists and has children, and 0 if the corresponding node does not exist/does not have children.
Returns
::BitMatrix: BitMatrix representation of the tree, where each column corresponds to a level of the binary tree. The inputs in the matrix are 1 if the corresponding node exists and has children, and 0 if the corresponding node does not exist/does not have children.
Visualization
# Binary tree
x
/ \
x o
/ \
x o
/ \
o o
# BitVector representation
[1,1,0,1,0,0,0]
# BitMatrix representation
[1 1 1 1;
1 1 0 0;
1 0 0 0]Examples
using Wavelets
import WaveletsExt: treenodes_matrix
tree = maketree(8, 3, :dwt)
treenodes_matrix(tree)