         return Math.abs(DESIRED_N_TICKS - (data_range / interval)))
       
       best_scale_ix = scale_ixs[argmin(errors)]
-      best_interval = @scales[best_scale_ix].get_interval(data_low, data_high)
-
-#       console.log("")
-#       console.log("CS.gi: intervals = #{intervals}")
-#       console.log("          errors = #{errors}")
-#       console.log("        interval = #{best_interval}")
-
-      return best_interval
+      best_scale = @scales[best_scale_ix]
+
+#       console.log("Selected #{best_scale.constructor.name}")
+
+      return best_scale
+
+    get_interval: (data_low, data_high) ->
+      best_scale = @get_best_scale(data_low, data_high)
+      return best_scale.get_interval(data_low, data_high)
+
+    get_ticks: (data_low, data_high) ->
+      best_scale = @get_best_scale(data_low, data_high)
+      return best_scale.get_ticks(data_low, data_high)
 
   class AdaptiveScale extends AbstractScale
     constructor: (mantissas, @base=10.0, @min_magnitude=0.0,

    get_max_interval: () ->
      return _.last(@max_intervals)

    get_interval: (data_low, data_high) ->
      data_range = float(data_high) - float(data_low)
      ideal_interval = @get_ideal_interval(data_low, data_high)
      scale_ixs = [

    new AdaptiveScale([1.0, 2.0, 4.0, 6.0, 8.0, 12.0], 24.0,
                      ONE_HOUR, ONE_HOUR),
 
    # Days.
    # FIXME Formatting is not happening quite right at the boundaries.
    new DayScale(),

    # Catchall for large timescales.
    new AdaptiveScale([1.0, 2.0, 5.0], 10.0, 10 * ONE_DAY, Infinity),
  ])

  auto_interval_temp = (data_low, data_high) ->
