MCPcopy Index your code
hub / github.com/DynamicTimeWarping/dtw-python / dtwPlotThreeWay

Function dtwPlotThreeWay

dtw/dtwPlot.py:206–318  ·  view source on GitHub ↗

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

(d, xts=None, yts=None,
                    match_indices=None,
                    match_col="gray",
                    xlab="Query index",
                    ylab="Reference index", **kwargs)

Source from the content-addressed store, hash-verified

204
205
206def dtwPlotThreeWay(d, xts=None, yts=None,
207 match_indices=None,
208 match_col="gray",
209 xlab="Query index",
210 ylab="Reference index", **kwargs):
211 # IMPORT_RDOCSTRING dtwPlotThreeWay
212 """Plotting of dynamic time warp results: annotated warping function
213
214Display the query and reference time series and their warping curve,
215arranged for visual inspection.
216
217**Details**
218
219The query time series is plotted in the bottom panel, with indices
220growing rightwards and values upwards. Reference is in the left panel,
221indices growing upwards and values leftwards. The warping curve panel
222matches indices, and therefore element (1,1) will be at the lower left,
223(N,M) at the upper right.
224
225Argument ``match_indices`` is used to draw a visual guide to matches; if
226a vector is given, guides are drawn for the corresponding indices in the
227warping curve (match lines). If integer, it is used as the number of
228guides to be plotted. The corresponding style is customized via the
229``match_col`` and ``match_lty`` arguments.
230
231If ``xts`` and ``yts`` are not supplied, they will be recovered from
232``d``, as long as it was created with the two-argument call of [dtw()]
233with ``keep_internals=True``. Only single-variate time series can be
234plotted.
235
236Parameters
237----------
238d :
239 an alignment result, object of class `dtw`
240xts :
241 query vector
242yts :
243 reference vector
244xlab :
245 label for the query axis
246ylab :
247 label for the reference axis
248main :
249 main title
250type_align :
251 line style for warping curve plot
252type_ts :
253 line style for timeseries plot
254match_indices :
255 indices for which to draw a visual guide
256margin :
257 outer figure margin
258inner_margin :
259 inner figure margin
260title_margin :
261 space on the top of figure
262... :
263 additional arguments, used for the warping curve

Callers 1

dtwPlotFunction · 0.85

Calls 1

plotMethod · 0.45

Tested by

no test coverage detected