reorganize do methods in graph; support for mutual linking of axes between graphs
[PyX/mjg.git] / examples / bargraphs / compare.py
blob4b5703f46d827ad0fdaab9c23156b9e723af50c0
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, 0", y=2),
15 graph.data.file("bar.dat", xname="$1, 1", y=3)],
16 [graph.style.bar()])
17 g.writeEPSfile("compare")
18 g.writePDFfile("compare")