Skip to content

Commit

Permalink
Merge pull request #90 from nicoddemus/patch-2
Browse files Browse the repository at this point in the history
Fix autoScale in scale_engine.py
  • Loading branch information
PierreRaybaut authored Dec 10, 2024
2 parents 5c98563 + f55e171 commit 9022b5a
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions qwt/scale_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -674,10 +674,9 @@ def autoScale(self, maxNumSteps, x1, x2, stepSize):
linearInterval = linearInterval.limited(LOG_MIN, LOG_MAX)

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

logRef = 1.0
Expand Down

0 comments on commit 9022b5a

Please sign in to comment.