Log scale and fft transform fix

If the plotted data is fourier transformed and an x log scale is chosen, the first bin causes an error because np.log10(0) doesn't make any sense.
This commit is contained in:
mrussell 2015-07-06 16:21:06 +01:00
parent 2888546de6
commit 392d2a3475

View File

@ -523,6 +523,10 @@ class PlotDataItem(GraphicsObject):
#y = y[::ds]
if self.opts['fftMode']:
x,y = self._fourierTransform(x, y)
# Ignore the first bin for fft data if we have a logx scale
if self.opts['logMode'][0]:
x=x[1:]
y=y[1:]
if self.opts['logMode'][0]:
x = np.log10(x)
if self.opts['logMode'][1]: