- some bargraph examples
[PyX/mjg.git] / examples / bargraphs / stacked.py
blob5e8a97ef59d014368b41a943a721b89e7aff2b52
1 # To stack bars on top of each other, you can add
2 # stackedbarpos styles and and bars to the styles.
3 # The stackbarpos need to get different column names
4 # each time to access new stack data. This example
5 # also adds text styles to the bars, which just
6 # repeat the value column data here, but they could
7 # refer to other columns as well.
9 from pyx import *
11 g = graph.graphxy(width=8, x=graph.axis.bar())
12 g.plot(graph.data.file("bar.dat", xname=0, y=2, stack=3),
13 [graph.style.bar(),
14 graph.style.text("y"),
15 graph.style.stackedbarpos("stack"),
16 graph.style.bar([color.rgb.green]),
17 graph.style.text("stack")])
18 g.writeEPSfile("stacked")