Skip to content

Commit 9022b5a

Browse files
Merge pull request #90 from nicoddemus/patch-2
Fix autoScale in scale_engine.py
2 parents 5c98563 + f55e171 commit 9022b5a

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

qwt/scale_engine.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -674,10 +674,9 @@ def autoScale(self, maxNumSteps, x1, x2, stepSize):
674674
linearInterval = linearInterval.limited(LOG_MIN, LOG_MAX)
675675

676676
if linearInterval.maxValue() / linearInterval.minValue() < logBase:
677-
if stepSize < 0.0:
678-
stepSize = -math.log(abs(stepSize), logBase)
679-
else:
680-
stepSize = math.log(stepSize, logBase)
677+
# The min / max interval is too short to be represented as a log scale.
678+
# Set the step to 0, so that a new step is calculated and a linear scale is used.
679+
stepSize = 0.0
681680
return x1, x2, stepSize
682681

683682
logRef = 1.0

0 commit comments

Comments
 (0)