Attributes
- DEFAULT_NUM_TICKS
DEFAULT_NUM_TICKS = 8
Method summary
- label_width(self, start, end, numlabels = None, char_width = None)
- labels(self, start, end, numlabels = None, char_width = None)
- num_ticks(self, start, end, desired_ticks = None)
- ticks(self, start, end, desired_ticks = None)
Methods
- label_width(self, start, end, numlabels = None, char_width = None)
Returns an estimate of the total number of characters used by the the labels that this scale produces for the given set of inputs, as well as the number of labels.
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.
Returns
(numlabels, total label width)
- labels(self, start, end, numlabels = None, char_width = None)
Returns a series of ticks and corresponding strings for labels that fall inside the interval (start,*end*).
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.
- num_ticks(self, start, end, desired_ticks = None)
Returns an approximate number of ticks that this scale produces for the given interval.
This method is used by the scale system to determine whether this is the appropriate scale to use for an interval; the returned number of ticks does not have to be exactly the same as what ticks() returns.
Parameters
- start : number
- The beginning of the scale interval.
- end : number
- The end of the scale interval.
- desired_ticks : integer
- Number of ticks that the caller would like to get
Returns
A float or an integer.
- ticks(self, start, end, desired_ticks = None)
Returns the set of "nice" positions on this scale that enclose and fall inside the interval (start,*end*).
Parameters
- start : number
- The beginning of the scale interval.
- end : number
- The end of the scale interval.
- desired_ticks : integer
- Number of ticks that the caller would like to get