Skip to content

Commit 651fb24

Browse files
committed
Fixed PythonQwt scale engine (0...1000 is now divided in 200-size steps)
(rounding issue)
1 parent 1adb337 commit 651fb24

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

qwt/scale_engine.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,11 +130,10 @@ def divideInterval(intervalSize, numSteps, base):
130130

131131
lx = math.log(abs(v), base)
132132
p = math.floor(lx)
133-
print("p:", p)
134133
fraction = math.pow(base, lx-p)
135134
n = base
136-
while n > 1 and fraction <= n/2:
137-
n /= 2
135+
while n > 1 and fraction <= n//2:
136+
n //= 2
138137

139138
stepSize = n*math.pow(base, p)
140139
if v < 0:

0 commit comments

Comments
 (0)