       data_range = float(data_high) - float(data_low)
       ideal_interval = @get_ideal_interval(data_low, data_high)
 
-      ideal_magnitude = Math.pow(@base, Math.floor(log(ideal_interval, @base)))
+      interval_exponent = Math.floor(log(ideal_interval / @base_factor, @base))
+      ideal_magnitude = Math.pow(@base, interval_exponent) * @base_factor
       ideal_mantissa = ideal_interval / ideal_magnitude
 
       # An untested optimization.

      start_factor = Math.floor(data_low / interval)
      end_factor   = Math.ceil(data_high / interval)
      factors = arange(start_factor, end_factor + 1)
      return factors.map((f) -> return f * interval)
  
  # FIXME Hopefully we won't actually need this.
  class SingleIntervalScale extends AbstractScale


      interval = best_mantissa * ideal_magnitude

#       console.log("  AS.gi: mantissas = #{candidate_mantissas}")
#       console.log("            errors = #{errors}")
#       console.log("          mantissa = #{best_mantissa}")
#       console.log("         magnitude = #{ideal_magnitude}")
#       console.log("          interval = #{interval}")

      return clamp(interval, @get_min_interval(), @get_max_interval())

