update upload data
[PyX.git] / examples / axis / link.txt
blobaddc940e89952aed6ca33890338cab8e8e0e2b06
1 Linking one axis to another one
3 When plotting two or more related graphs, you sometimes want to have identical
4 axes. This example demonstrates how to achieve this goal in PyX using a
5 `linkedaxis`. ...
7 In order to arrange the two graphs, we first create a canvas `c`, in which
8 we insert the first graph `g1` (the lower panel in the output), which contains the graph of a function.
10 In the next graph `g2` (the upper panel in the output), we now refer to the
11 x-axis of `g1`. We do this by creating a `graph.axis.linkedaxis` instance
12 passing the x-axis of `g1` as the only argument. The latter is obtained from
13 the axis dictionary `axes` of the graph.
15 Note that for a linked axis, PyX automatically turns off the drawing of the axis
16 labels, as you can see in the upper panel. If you do not like this behaviour, you
17 have to pass a different axis painter to the `linkedaxis` constructor.