From fe7e1775da21e2af7c172f6a3c00509ddd861351 Mon Sep 17 00:00:00 2001 From: David Nadlinger Date: Wed, 11 Jul 2018 15:31:29 +0100 Subject: [PATCH] AxisItem: Fix tick elision with self.scale set Previously, only the highest level ticks would be displayed for e.g. scale = 1e3. --- pyqtgraph/graphicsItems/AxisItem.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyqtgraph/graphicsItems/AxisItem.py b/pyqtgraph/graphicsItems/AxisItem.py index b125cb7e..19c5e1f0 100644 --- a/pyqtgraph/graphicsItems/AxisItem.py +++ b/pyqtgraph/graphicsItems/AxisItem.py @@ -693,7 +693,7 @@ class AxisItem(GraphicsWidget): ## remove any ticks that were present in higher levels ## we assume here that if the difference between a tick value and a previously seen tick value ## is less than spacing/100, then they are 'equal' and we can ignore the new tick. - values = list(filter(lambda x: all(np.abs(allValues-x) > spacing*0.01), values) ) + values = list(filter(lambda x: all(np.abs(allValues-x) > spacing/self.scale*0.01), values)) allValues = np.concatenate([allValues, values]) ticks.append((spacing/self.scale, values))