Method summary
- __init__(self, *scales, **kw)
- labels(self, start, end, numlabels = None, char_width = None)
- ticks(self, start, end, numticks = None)
Methods
- __init__(self, *scales, **kw)
Creates a ScaleSystem
Usage:
ScaleSystem(scale1, .., scaleN, default_scale = DefaultScale())
If default_scale is not specified, then an instance of DefaultScale() is created. If no default_scale is needed, then set it to None.
- labels(self, start, end, numlabels = None, char_width = None)
Computes position and labels for an interval
Parameters
- start : number
- The beginning of the scale interval.
- end : number
- The end of the scale interval.
- numlabels : number
- The ideal number of labels to generate on the interval.
- char_width : number
- The total character width available for labelling the interval.
One of numlabels or char_width must be provided. If both are provided, then both are considered when picking label density and format.
Returns
A list of (tick position, string) tuples.
- ticks(self, start, end, numticks = None)
Computes nice locations for tick marks.
Parameters
- start, end : number
- The start and end values of the data.
- numticks : number
- The desired number of ticks to produce.
- scales : a list of tuples of (min_interval, Scale)
- Scales to use, in order from fine resolution to coarse. If the end-start interval is less than a particular scale's min_interval, then the previous scale is used.
Returns
A list of positions where the ticks are to be placed.