dtwPlotTwoWay

dtw.dtwPlotTwoWay(d, xts=None, yts=None, offset=0, ts_type='l', match_indices=None, match_col='gray', xlab='Index', ylab='Query value', **kwargs)

Plotting of dynamic time warp results: pointwise comparison

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

Details

The two vectors are displayed via the [matplot()] functions; their appearance can be customized via the type and pch arguments (constants or vectors of two elements). If offset is set, the reference is shifted vertically by the given amount; this will be reflected by the right-hand axis.

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 this way.

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

  • xts – query vector

  • yts – reference vector

  • xlab – axis labels

  • ylab – axis labels

  • offset – displacement between the timeseries, summed to reference

  • match_col – color and line type of the match guide lines

  • match_lty – color and line type of the match guide lines

  • match_indices – indices for which to draw a visual guide

  • ts_type – graphical parameters for timeseries plotting, passed to matplot

  • pch – graphical parameters for timeseries plotting, passed to matplot

  • ... – additional arguments, passed to matplot

Notes

When offset is set values on the left axis only apply to the query.