-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Labels
Description
Activating the FFT transform on data with one point raises the following error:
File ~\anaconda3\lib\site-packages\pyqtgraph\graphicsItems\PlotDataItem.py:1190 in _fourierTransform
uniform = not np.any(np.abs(dx-dx[0]) > (abs(dx[0]) / 1000.))
IndexError: index 0 is out of bounds for axis 0 with size 0
This occurs because dx = np.diff(x) is empty when x is of size 1.
A possible solution is to add the following condition if len(x) == 1: return np.array([0]), abs(y) in the beginning of _fourierTransform in PlotDataItem.py.
- PyQtGraph version: tested on 0.13.3 but will also raise same error in 0.13.7 has the relevant code has not changed.
Reactions are currently unavailable