gdesk.utils.ticks module¶
- class gdesk.utils.ticks.Ticks(minVal, maxVal, scale, minimumSpacing=None, noDecimals=False)¶
Bases:
object
- update(minVal, maxVal, scale)¶
- gdesk.utils.ticks.getOptimalMinimumSpacing(minVal, maxVal, scale=1)¶
- gdesk.utils.ticks.tickSpacing(minimumSpacing=1, noDecimals=False)¶
Return values describing the desired spacing and offset of ticks.
This method is called whenever the axis needs to be redrawn and is a good method to override in subclasses that require control over tick locations.
The return value must be a list of three tuples:
[ (major tick spacing, offset), (minor tick spacing, offset), (micro tick spacing, offset), ... ]
- gdesk.utils.ticks.tickValues(minVal, maxVal, scale, minimumSpacing=None, noDecimals=False)¶
Return the values and spacing of ticks to draw:
[ (spacing, [major ticks]), (spacing, [minor ticks]), ... ]
By default, this method calls tickSpacing to determine the correct tick locations. This is a good method to override in subclasses.