apply pyx theme to FAQ
[PyX.git] / examples / axis / parter.txt
blob830643387dcc09eec9496ee9d2ac088de1a3a83d
1 Parter: Control over the partitioning of the axis
3 In the above example, the (default) automatic choice of a good partitioning has
4 been selected. Here, we show how to gain more control over the ticks, in order
5 to fix their intervals. ...
7 Partitioners (in the code the short form `parter` is used) take care of
8 calculating appropriate tick positions for a given axis range. Automatic
9 partitioners create several tick lists, which are than rated by an axis rater
10 instance, as explained in the above example. In contrast, manual partitioners
11 create a single tick list only, which thus doesn't need to be rated at all.
13 In this example we create a manual partitioner, which places ticks with a
14 distance of 1/3 and subticks with a distance of 1/6. We then use this
15 partitioner at two axis, which are identical except for a texter instance (to
16 show you another feature of the axes in PyX, namely the rational number
17 arithmetics used to place ticks). The rational numbers are preserved throughout
18 the whole process of merging ticks, until the texter finally needs to output
19 the rational numbers. And at the very end the decimal texter steps into the
20 problem to create a proper representation for the fractions. The solution is
21 shown at the left part of the example: the texter marks a period to express the
22 fraction.
24 Alternatively you can use the rational texter to display the values by
25 fractions directly.