scale
lq.scale.scale(transform, inverse, name="", identity=0, locate-ticks=none, locate-subticks=none, ..args)(source)
Constructor for the scale type. Scales are used to transform data coordinates into scaled coordinates. Commonly, data is displayed with a linear scale, i.e., the entire data is just scaled uniformly. However, in order to visualize large ranges, it is often desirable to use logarithmic scaling or other scales that improve the readability of the data.
transform : function
Transformation from data coordinates to scaled coordinates.
Note that the transformation function does not need to worry about
absolute scaling and offsets. As an example, the transformation function
for the linear scale is just x => x
and not something like
x => a * x + b
. The logarithmic scale uses x => calc.log(x)
.
inverse : function
A precise inverse of the transform
in order to enable the conversion of
scaled coordinates back to data coordinates.
name : str
default: ""
Name of the scale. Built-in scales are sometimes identified by their name, e.g., when a suitable tick locator needs to be selected automatically.
identity : int
| float
default: 0
An identity value which can be used to find an initial axis range when no limits or plots are given. Scales like logarithmic scales that are only defined for positive values should set this to 1.
locate-ticks : none
| function
default: none
The default tick locator to use with this scale.
locate-subticks : none
| function
default: none
The default subtick locator to use with this scale.
..args : any
Additional data to store in the scale.