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)$"))
14 g
.stroke(g
.ygridpath(0))
16 g
.writeEPSfile("piaxis")
17 g
.writePDFfile("piaxis")