dtwPlot | R Documentation |
Methods for plotting dynamic time warp alignment objects returned by
dtw()
.
## S3 method for class 'dtw' plot(x, type = "alignment", ...) dtwPlotAlignment( d, xlab = "Query index", ylab = "Reference index", plot.type = "l", ... )
x, d |
|
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 |
dtwPlot
displays alignment contained in dtw
objects.
Various plotting styles are available, passing strings to the type
argument (may be abbreviated):
alignment
plots the warping curve in d
;
twoway
plots a point-by-point comparison, with matching lines; see dtwPlotTwoWay()
;
threeway
vis-a-vis inspection of the timeseries and their warping curve; see dtwPlotThreeWay()
;
density
displays the cumulative cost landscape with the warping path overimposed; see dtwPlotDensity()
Additional parameters are passed to the plotting functions: use with care.
These functions are incompatible with mechanisms for
arranging plots on a device: par(mfrow)
, layout
and
split.screen
.
Toni Giorgino
dtwPlotTwoWay()
, dtwPlotThreeWay()
and dtwPlotDensity()
for details
on the respective plotting styles.
Other plot:
dtwPlotDensity()
,
dtwPlotThreeWay()
,
dtwPlotTwoWay()
## 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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.