Skip to content

ModifiedLog Scales

Pre-release
Pre-release
Compare
Choose a tag to compare
@bmalehorn bmalehorn released this 21 Jul 20:35
· 7458 commits to master since this release

ModifiedLog

screen shot 2014-07-21 at 1 40 01 pm

This release adds Plottable.Scale.ModifiedLog, which can be used the same way as a Plottable.Scale.Linear:

var yScale = new Plottable.Scale.ModifiedLog();
...

A ModifiedLog scale behaves mostly the same as a log scale, but as x approaches 0, modifiedLog(x) approaches 0 instead of -Infinity. For a more in-depth explanation, see #710.

ModifiedLog is intended as a replacement for Plottable.Scale.Log, which is very buggy due to not being able to handle 0 and negative numbers.

API changes

  • Plottable.Scale.ModifiedLog class has been added, to be used the same way as any QuantitiveScale.
  • Plottable.Scale.ModifiedLog.showIntermediateTicks(bool) has been added. By default, ModifiedLog only shows ticks on powers of 10, like [10, 100, 1000]. If scale.showIntermediateTicks(true) is called, it will show ticks in between, like [10, 30, 70, 100, 300, 700, 1000].
  • Plottable.Scale.Log is deprecated.

Release Song

Get Away From You, Martin Solveig