Skip to content

Commit 9f0453f

Browse files
committed
Fix #33
1 parent adbeb57 commit 9f0453f

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

‎dtw/dtwPlot.py‎

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

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

170168
fig, ax = plt.subplots()
171169

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

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

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

0 commit comments

Comments
 (0)