Skip to content

Commit 8c79531

Browse files
committed
1 parent 0872a21 commit 8c79531

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

dtw/dtwPlot.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -161,18 +161,16 @@ def dtwPlotTwoWay(d, xts=None, yts=None,
161161
# ytso = yts + offset
162162
offset = -offset
163163

164-
maxlen = max(len(xts), len(yts))
165-
times = numpy.arange(maxlen)
166-
xts = numpy.pad(xts,(0,maxlen-len(xts)),"constant",constant_values=numpy.nan)
167-
yts = numpy.pad(yts,(0,maxlen-len(yts)),"constant",constant_values=numpy.nan)
164+
xtimes = numpy.arange(len(xts))
165+
ytimes = numpy.arange(len(yts))
168166

169167
fig, ax = plt.subplots()
170168

171169
ax.set_xlabel(xlab)
172170
ax.set_ylabel(ylab)
173171

174-
ax.plot(times, xts, color='k', **kwargs)
175-
ax.plot(times, yts - offset, **kwargs) # Plot with offset applied
172+
ax.plot(xtimes, xts, color='k', **kwargs)
173+
ax.plot(ytimes, yts - offset, **kwargs) # Plot with offset applied
176174

177175
if offset != 0:
178176
# Create an offset axis

0 commit comments

Comments
 (0)