dtwPlotThreeWay

dtw.dtwPlotThreeWay(d, xts=None, yts=None, match_indices=None, match_col='gray', xlab='Query index', ylab='Reference index', **kwargs)

Plotting of dynamic time warp results: annotated warping function

Display the query and reference time series and their warping curve, arranged for visual inspection.

Details

The query time series is plotted in the bottom panel, with indices growing rightwards and values upwards. Reference is in the left panel, indices growing upwards and values leftwards. The warping curve panel matches indices, and therefore element (1,1) will be at the lower left, (N,M) at the upper right.

Argument match_indices is used to draw a visual guide to matches; if a vector is given, guides are drawn for the corresponding indices in the warping curve (match lines). If integer, it is used as the number of guides to be plotted. The corresponding style is customized via the match_col and match_lty arguments.

If xts and yts are not supplied, they will be recovered from d, as long as it was created with the two-argument call of [dtw()] with keep_internals=True. Only single-variate time series can be plotted.

Parameters:
  • d – an alignment result, object of class dtw

  • xts – query vector

  • yts – reference vector

  • xlab – label for the query axis

  • ylab – label for the reference axis

  • main – main title

  • type_align – line style for warping curve plot

  • type_ts – line style for timeseries plot

  • match_indices – indices for which to draw a visual guide

  • margin – outer figure margin

  • inner_margin – inner figure margin

  • title_margin – space on the top of figure

  • ... – additional arguments, used for the warping curve