dtwPlotTwoWay(d,xts=NULL,yts=NULL, offset=0,
type="o",pch=21,
xlab="Index", ylab="Query value",
match.col="gray70",
... )
dtw
matplot
matplot
par(mfrow)
,
layout
and split.screen
. The two vectors are displayed via the matplot
functions,
and their appearance can be customized via type
and pch
arguments (constants or vectors of two elements). If offset
is
set, the template is offset by the given amount; this will be
reflected by the right-hand axis.
Only single-variate time series can be plotted this way.
dtwPlot
for other dtw plotting functions,
matplot
for graphical parameters.## 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,step=asymmetricP1)->alignment;
## Equivalent to plot(alignment,xts=query,yts=template,type="two");
dtwPlotTwoWay(alignment,xts=query,yts=template);
## Beware of the template's y axis, may be confusing
plot(alignment,xts=query,yts=template,offset=-2,type="two");
legend("topright",c("Query","Template"), pch=21, col=1:6)
Run the code above in your browser using DataLab