build pdf examples; remove examples-document from distribution
[PyX.git] / examples / bargraphs / compare.py
blob95de24adff8de81e3aa10b3c89737bf04a7ac3b8
1 # When plotting several bars with the same style in a bar graph,
2 # they are plotted side by side. You have to create a nested bar
3 # axis to make each position in the bar graph to contain another
4 # bar axis.
6 from pyx import *
8 bap = graph.axis.painter.bar
9 a = graph.axis.nestedbar(painter=bap(nameattrs=[trafo.rotate(45),
10 text.halign.right],
11 innerticklength=0.2))
13 g = graph.graphxy(width=8, x=a)
14 g.plot([graph.data.file("bar.dat", xname=1, y=2),
15 graph.data.file("bar.dat", xname=1, y=3)],
16 [graph.style.bar()])
17 g.writeEPSfile("compare")
18 g.writePDFfile("compare")