Merge pull request #723 from klickverbot/scaled-ticks

AxisItem: Fix tick elision with self.scale set
This commit is contained in:
Luke Campagnola 2018-07-11 08:58:24 -07:00 committed by GitHub
commit 41d2bc03a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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))