File: shift.py

package info (click to toggle)
pyx3 0.17-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,328 kB
  • sloc: python: 27,656; makefile: 225; ansic: 130; sh: 17
file content (18 lines) | stat: -rw-r--r-- 731 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# You can manually set the subaxes and exceed the axes ranges.
# The width of the regular axes can be modified by a size parameter.
# While most axes do not have a size parameter, it can be added to
# any existing axis very easily. For linear axes so called sizedlinear
# and autosizedlinear axes are defined by PyX already.

from pyx import *

subaxes = [graph.axis.linear(max=1),
           graph.axis.linear(max=1),
           graph.axis.sizedlinear(size=3, min=0, max=3)]

g = graph.graphxy(width=8, y=graph.axis.split(subaxes=subaxes, epsilon=None))
g.plot([graph.data.file("shift.dat", x=1, y="i, $(i+2)", context={"i": i})
        for i in range(3)], [graph.style.line()])
g.writeEPSfile()
g.writePDFfile()
g.writeSVGfile()