From fb41aa2d408bd36f5055fdec3286acaf49e65578 Mon Sep 17 00:00:00 2001 From: Luke Campagnola Date: Sat, 14 Mar 2015 15:25:25 -0400 Subject: [PATCH] Fixed python 3 plot downsampling --- pyqtgraph/graphicsItems/PlotDataItem.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyqtgraph/graphicsItems/PlotDataItem.py b/pyqtgraph/graphicsItems/PlotDataItem.py index 6148989d..520151a3 100644 --- a/pyqtgraph/graphicsItems/PlotDataItem.py +++ b/pyqtgraph/graphicsItems/PlotDataItem.py @@ -569,11 +569,11 @@ class PlotDataItem(GraphicsObject): x = x[::ds] y = y[::ds] elif self.opts['downsampleMethod'] == 'mean': - n = len(x) / ds + n = len(x) // ds x = x[:n*ds:ds] y = y[:n*ds].reshape(n,ds).mean(axis=1) elif self.opts['downsampleMethod'] == 'peak': - n = len(x) / ds + n = len(x) // ds x1 = np.empty((n,2)) x1[:] = x[:n*ds:ds,np.newaxis] x = x1.reshape(n*2)