~ubuntu-branches/ubuntu/trusty/pyx/trusty

« back to all changes in this revision

Viewing changes to examples/axis/manualticks.py

  • Committer: Bazaar Package Importer
  • Author(s): Thomas Viehmann
  • Date: 2006-11-26 14:04:53 UTC
  • mfrom: (2.1.3 edgy)
  • Revision ID: james.westby@ubuntu.com-20061126140453-1dq3cycpspmlik2t
Tags: 0.9-3
* New maintainer. Thank you for more than three years of
  maintenance,  Graham! Closes: #400087
* Don't hard-code python 2.3 in manual/Makefile.
  Thanks to Matthias Klose for the bug report and patch.
  Closes: #392634
* Remove obsolete dh_python call from debian/rules.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Ticks can be set manually in combination with automatically created
2
 
# ticks. Note that the rating takes into account the manual ticks as
3
 
# well.
4
 
 
5
1
import math
6
2
from pyx import *
7
 
from pyx.graph import axis
8
3
 
9
4
p = path.curve(0, 0, 3, 0, 1, 4, 4, 4)
10
5
 
11
 
myticks = [axis.tick.tick(math.pi, label="\pi", labelattrs=[text.mathmode]),
12
 
           axis.tick.tick(2*math.pi, label="2\pi", labelattrs=[text.mathmode])]
 
6
myticks = [graph.axis.tick.tick(math.pi, label="\pi", labelattrs=[text.mathmode]),
 
7
           graph.axis.tick.tick(2*math.pi, label="2\pi", labelattrs=[text.mathmode])]
13
8
 
14
9
c = canvas.canvas()
15
 
c.insert(axis.pathaxis(p, axis.linear(min=0, max=10)))
16
 
c.insert(axis.pathaxis(p.transformed(trafo.translate(4, 0)),
17
 
                       axis.linear(min=0, max=10, manualticks=myticks)))
 
10
c.insert(graph.axis.pathaxis(p, graph.axis.linear(min=0, max=10)))
 
11
c.insert(graph.axis.pathaxis(p.transformed(trafo.translate(4, 0)),
 
12
                             graph.axis.linear(min=0, max=10, manualticks=myticks)))
18
13
c.writeEPSfile("manualticks")
 
14
c.writePDFfile("manualticks")