dtwPlotThreeWay {dtw} | R Documentation |
Plot a DTW results for visual inspection.
dtwPlotThreeWay(d,xts=NULL,yts=NULL,type.align="p",type.ts="l", margin=4, inner.margin=0.2, title.margin=1.5, xlab="Query index",ylab="Template index",main="Timeseries alignment", ... )
d |
an alignment result, object of class dtw |
xts |
query vector |
yts |
template vector |
xlab |
label for the query axis |
ylab |
label for the template axis |
main |
main title |
type.align |
line style for alignment path plot |
type.ts |
line style for timeseries plot |
margin |
outer figure margin |
inner.margin |
inner figure margin |
title.margin |
space on the top of figure |
... |
additional arguments, passed to plotting functions |
Display the query and template time series and their alignment, arranged so that alignment can be visually inspected.
Only single-variate time series are supported, and they must be passed
to the xts
and yts
arguments (query and template are not
stored in the dtw
object).
These functions are incompatible with mechanisms for
arranging plots on a device: par(mfrow)
, layout
and
split.screen
.
The value axis for the template time series grows rightwards. This may be counter-intuitive.
Toni Giorgino
## A noisy sine wave as query ## A cosine is for template; sin and cos are offset by 25 samples idx<-seq(0,6.28,len=100); query<-sin(idx)+runif(100)/10; template<-cos(idx) dtw(query,template,keep=TRUE)->alignment; ## Beware of the template's y axis, may be confusing ## Equivalent to plot(alignment,xts=query,yts=template,type="three"); dtwPlotThreeWay(alignment,xts=query,yts=template);