File: simple.py

package info (click to toggle)
pyx 0.7.1-2
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 1,756 kB
  • ctags: 2,584
  • sloc: python: 12,675; ansic: 1,711; makefile: 168; sh: 16
file content (12 lines) | stat: -rw-r--r-- 517 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
# This is the basic example how to draw an axis along an arbitrary
# path. The function pathaxis from the graph.axis module takes a path
# and returns a canvas. Different from the typical usecase in graphs,
# we must fix the axis range by appropriate min and max arguments,
# because of missing data. In graphs the range can be adjusted
# automatically.

from pyx import *

c = graph.axis.pathaxis(path.curve(0, 0, 3, 0, 1, 4, 4, 4),
                        graph.axis.linear(min=0, max=10))
c.writeEPSfile("simple")