python2 compat: don't assume true division

This commit is contained in:
KIU Shueng Chuan 2017-01-20 09:09:18 +08:00
parent 0a8d5b253a
commit 4553b55f73

View File

@ -681,7 +681,7 @@ class PlotDataItem(GraphicsObject):
x = x2
n = y.size
f = np.fft.rfft(y) / n
d = (x[-1] - x[0]) / (n - 1)
d = float(x[-1]-x[0]) / (len(x)-1)
x = np.fft.rfftfreq(n, d)
y = np.abs(f)
return x, y