~ubuntu-branches/debian/sid/pyx/sid

« back to all changes in this revision

Viewing changes to examples/axis/grid.py

  • Committer: Package Import Robot
  • Author(s): Stuart Prescott
  • Date: 2012-12-17 13:45:12 UTC
  • mfrom: (1.1.4)
  • mto: This revision was merged to the branch mainline in revision 10.
  • Revision ID: package-import@ubuntu.com-20121217134512-u0w6lrgdowsc1sfu
Tags: 0.12.1-1
* New upstream release
* Update maintainer address.
* Update copyright format URL.
* Bump standards version to 3.9.4 (no changes required).
* Drop postinst that was needed for lenny->squeeze upgrades.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
from math import pi
 
2
from pyx import *
 
3
from pyx.graph import axis
 
4
 
 
5
xgridpainter = axis.painter.regular(gridattrs=[])
 
6
ygridpainter = axis.painter.regular(gridattrs=[attr.changelist([style.linestyle.dashed, None])])
 
7
 
 
8
g = graph.graphxy(width=10,
 
9
                  x=axis.lin(painter=xgridpainter,
 
10
                             divisor=pi, texter=axis.texter.rational(suffix=r"\pi"), min=-4*pi, max=4*pi),
 
11
                  y=axis.lin(painter=ygridpainter))
 
12
 
 
13
g.plot(graph.data.function("y(x)=sin(x)/x", points=200))
 
14
 
 
15
g.writeEPSfile()
 
16
g.writePDFfile()