5.4 Module graph.axis.parter: Partitioners

The following classes are part of the module graph.axis.parter. Instances of the classes can be passed to the parter keyword argument of regular axes.

class linear( tickdists=None, labeldists=None, extendtick=0, extendlabel=None, epsilon=1e-10)
Instances of this class creates equally spaced tick lists. The distances between the ticks, subticks, subsubticks etc. starting from a tick at zero are given as first, second, third etc. item of the list tickdists. For a tick position, the lowest level wins, i.e. for [2, 1] even numbers will have ticks whereas subticks are placed at odd integer. The items of tickdists might be strings, floats or tuples as described for the pos parameter of class tick.

labeldists works equally for placing labels. When labeldists is kept None, labels will be placed at each tick position, but sublabels etc. will not be used. This copy behaviour is also available vice versa and can be disabled by an empty list.

extendtick can be set to a tick level for including the next tick of that level when the data exceeds the range covered by the ticks by more than epsilon. epsilon is taken relative to the axis range. extendtick is disabled when set to None or for fixed range axes. extendlabel works similar to extendtick but for labels.

class lin( ...)
This class is an abbreviation of linear described above.

class autolinear( variants=defaultvariants, extendtick=0, epsilon=1e-10)
Instances of this class creates equally spaced tick lists, where the distance between the ticks is adjusted to the range of the axis automatically. Variants are a list of possible choices for tickdists of linear. Further variants are build out of these by multiplying or dividing all the values by multiples of 10. variants should be ordered that way, that the number of ticks for a given range will decrease, hence the distances between the ticks should increase within the variants list. extendtick and epsilon have the same meaning as in linear.

defaultvariants
[[tick.rational((1, 1)), tick.rational((1, 2))], [tick.rational((2, 1)), tick.rational((1, 1))], [tick.rational((5, 2)), tick.rational((5, 4))], [tick.rational((5, 1)), tick.rational((5, 2))]]

class autolin( ...)
This class is an abbreviation of autolinear described above.

class preexp( pres, exp)
This is a storage class defining positions of ticks on a logarithmic scale. It contains a list pres of positions $p_i$ and exp, a multiplicator $m$. Valid tick positions are defined by $p_im^n$ for any integer $n$.

class logarithmic( tickpreexps=None, labelpreexps=None, extendtick=0, extendlabel=None, epsilon=1e-10)
Instances of this class creates tick lists suitable to logarithmic axes. The positions of the ticks, subticks, subsubticks etc. are defined by the first, second, third etc. item of the list tickpreexps, which are all preexp instances.

labelpreexps works equally for placing labels. When labelpreexps is kept None, labels will be placed at each tick position, but sublabels etc. will not be used. This copy behaviour is also available vice versa and can be disabled by an empty list.

extendtick, extendlabel and epsilon have the same meaning as in linear.

Some preexp instances for the use in logarithmic are available as instance variables (should be used read-only):

pre1exp5
preexp([tick.rational((1, 1))], 100000)

pre1exp4
preexp([tick.rational((1, 1))], 10000)

pre1exp3
preexp([tick.rational((1, 1))], 1000)

pre1exp2
preexp([tick.rational((1, 1))], 100)

pre1exp
preexp([tick.rational((1, 1))], 10)

pre125exp
preexp([tick.rational((1, 1)), tick.rational((2, 1)), tick.rational((5, 1))], 10)

pre1to9exp
preexp([tick.rational((1, 1)) for x in range(1, 10)], 10)

class log( ...)
This class is an abbreviation of logarithmic described above.

class autologarithmic( variants=defaultvariants, extendtick=0, extendlabel=None, epsilon=1e-10)
Instances of this class creates tick lists suitable to logarithmic axes, where the distance between the ticks is adjusted to the range of the axis automatically. Variants are a list of tuples with possible choices for tickpreexps and labelpreexps of logarithmic. variants should be ordered that way, that the number of ticks for a given range will decrease within the variants list.

extendtick, extendlabel and epsilon have the same meaning as in linear.

defaultvariants
[([log.pre1exp, log.pre1to9exp], [log.pre1exp, log.pre125exp]), ([log.pre1exp, log.pre1to9exp], None), ([log.pre1exp2, log.pre1exp], None), ([log.pre1exp3, log.pre1exp], None), ([log.pre1exp4, log.pre1exp], None), ([log.pre1exp5, log.pre1exp], None)]

class autolog( ...)
This class is an abbreviation of autologarithmic described above.