2 import sys
; sys
.path
[:0] = ["../.."]
6 from pyx
import mathtree
, attr
9 g
= c
.insert(graph
.graphxy(x
, y
, height
=5, width
=5, x
=graph
.axis
.bar(title
="Month", painter
=graph
.axis
.painter
.bar(nameattrs
=[text
.halign
.right
, trafo
.rotate(90)]))))
10 g
.plot(graph
.data
.file("data/testdata2", xname
=1, y
=2, text
=2), [graph
.style
.barpos(fromvalue
=0), graph
.style
.bar(), graph
.style
.text()])
12 def test_bar2(c
, x
, y
):
13 g
= c
.insert(graph
.graphxy(x
, y
, height
=5, width
=5, y
=graph
.axis
.bar(title
="Month")))
14 g
.plot(graph
.data
.file("data/testdata2", x
=2, dx
="1", yname
=1), [graph
.style
.bar(), graph
.style
.errorbar()])
16 def test_bar3(c
, x
, y
):
17 g
= c
.insert(graph
.graphxy(x
, y
, height
=5, width
=12, x
=graph
.axis
.bar(multisubaxis
=graph
.axis
.bar(dist
=0), painter
=graph
.axis
.painter
.bar(innerticklength
=0.2)), key
=graph
.key
.key()))
18 g
.plot([graph
.data
.file("data/testdata2", xname
=1, y
=2),
19 graph
.data
.file("data/testdata2", xname
=1, y
=3),
20 graph
.data
.file("data/testdata2", xname
=1, y
=3, title
=None)], [graph
.style
.bar()])
22 def test_bar4(c
, x
, y
):
23 g
= c
.insert(graph
.graphxy(x
, y
, height
=5, width
=12, x
=graph
.axis
.bar(graph
.axis
.bar(dist
=0)), key
=graph
.key
.key()))
24 g
.plot([graph
.data
.file("data/testdata2", xname
=0, y
=2, ystack1
=3, title
="test"),
25 graph
.data
.file("data/testdata2", xname
=0, y
="$2-1", ystack1
=3)],
26 [graph
.style
.bar(), graph
.style
.stackedbarpos("ystack1"), graph
.style
.bar([color
.palette
.ReverseRainbow
])])
33 c
.writeEPSfile("test_bargraph", paperformat
="a4")