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

« back to all changes in this revision

Viewing changes to examples/axis/manualticks.py

  • Committer: Bazaar Package Importer
  • Author(s): Stuart Prescott
  • Date: 2011-05-20 00:13:52 UTC
  • mto: (9.1.1 experimental)
  • mto: This revision was merged to the branch mainline in revision 8.
  • Revision ID: james.westby@ubuntu.com-20110520001352-odcuqpdezuusbbw1
Tags: upstream-0.11.1
ImportĀ upstreamĀ versionĀ 0.11.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
import math
2
2
from pyx import *
3
3
 
4
 
p = path.curve(0, 0, 3, 0, 1, 4, 4, 4)
 
4
p1 = path.curve(0, 0, 3, 0, 1, 4, 4, 4)
 
5
p2 = p1.transformed(trafo.translate(4, 0))
5
6
 
6
7
myticks = [graph.axis.tick.tick(math.pi, label="\pi", labelattrs=[text.mathmode]),
7
8
           graph.axis.tick.tick(2*math.pi, label="2\pi", labelattrs=[text.mathmode])]
8
9
 
9
10
c = canvas.canvas()
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)))
 
11
c.insert(graph.axis.pathaxis(p1, graph.axis.linear(min=0, max=10)))
 
12
c.insert(graph.axis.pathaxis(p2, graph.axis.linear(min=0, max=10, manualticks=myticks)))
13
13
c.writeEPSfile("manualticks")
14
14
c.writePDFfile("manualticks")