dtwPlot: Plotting of dynamic time warp results

Description Usage Arguments Details Warning Author(s) See Also Examples

Description

Methods for plotting dynamic time warp alignment objects returned by dtw().

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## S3 method for class 'dtw'
plot(x, type = "alignment", ...)

dtwPlotAlignment(
  d,
  xlab = "Query index",
  ylab = "Reference index",
  plot.type = "l",
  ...
)

Arguments

x, d

dtw object, usually result of call to dtw()

type

general style for the plot, see below

...

additional arguments, passed to plotting functions

xlab

label for the query axis

ylab

label for the reference axis

plot.type

type of line to be drawn, used as the type argument in the underlying plot call

Details

dtwPlot displays alignment contained in dtw objects.

Various plotting styles are available, passing strings to the type argument (may be abbreviated):

Additional parameters are passed to the plotting functions: use with care.

Warning

These functions are incompatible with mechanisms for arranging plots on a device: par(mfrow), layout and split.screen.

Author(s)

Toni Giorgino

See Also

dtwPlotTwoWay(), dtwPlotThreeWay() and dtwPlotDensity() for details on the respective plotting styles.

Other plot: dtwPlotDensity(), dtwPlotThreeWay(), dtwPlotTwoWay()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
## Same example as in dtw

idx<-seq(0,6.28,len=100);
query<-sin(idx)+runif(100)/10;
reference<-cos(idx)

alignment<-dtw(query,reference,keep=TRUE);

# A sample of the plot styles. See individual plotting functions for details

plot(alignment, type="alignment",
  main="DTW sine/cosine: simple alignment plot")
  
plot(alignment, type="twoway",
  main="DTW sine/cosine: dtwPlotTwoWay")

plot(alignment, type="threeway",
  main="DTW sine/cosine: dtwPlotThreeWay")
  
plot(alignment, type="density",
  main="DTW sine/cosine: dtwPlotDensity")
  

dtw documentation built on Oct. 23, 2020, 8:11 p.m.