1 Drawing a graph with grid lines
3 The drawing of grid lines is performed by the axis painters of the graph. ...
4 In order to turn on a grid, one has to specify in the argument `gridattrs` a
5 list of attributes defining the way the grid should look like. In order to
6 enable a grid at the position of the axis ticks and subticks, it is enough to
7 set `gridattrs` to an empty list. In the example, this is done for the grid
8 corresponding to the x-axis. If one wants to control the style of the grid
9 lines or even turn them off selectively for the main or subticks, one can pass
10 `attr.changelist` instances in the list. The first item of the argument of this
11 class is then used for the main ticks, the second for the first subticks, and
12 so on. In the example, it is shown how to change the linestyle of the grid at
13 the main tick positions and to turn off the grid for the subticks by setting
14 the correpsonding value in the `attr.changelist` instance to `None`.
16 ! The example also shows a neat trick how to create an axis with axis labels at
17 fractions of pi. This can be achieved by passing a `divisor` argument to the
18 axis itself, which means that for the axis handling, all values are divided by
19 the corresponding value. Then, we automatically put ticks at the position of
20 rational number by means of `axis.texter.rational` and add the missing factor
21 pi at the end of the TeX output.