add TODO
[PyX/mjg.git] / gallery / graphs / piaxis.py
blobabb06f9a7229a485f5f7184d4b4f3506c88da5ea
1 from math import pi
2 from pyx import *
3 from pyx.graph import axis
5 g = graph.graphxy(width=8, key=graph.key.key(pos="bl"),
6 x=axis.linear(min=0, max=2*pi, title="$x$", divisor=pi,
7 texter=axis.texter.rational(suffix=r"\pi")),
8 y=axis.linear(title="$y$"))
10 g.plot(graph.data.function("y(x)=sin(x)", title=r"$\sin(x)$"))
11 g.plot(graph.data.function("y(x)=cos(x)", title=r"$\cos(x)$"))
13 g.finish()
14 g.stroke(g.ygridpath(0))
16 g.writeEPSfile("piaxis")
17 g.writePDFfile("piaxis")