reencoding->recompression
[PyX/mjg.git] / examples / bargraphs / errors.py
blob75e65dc36ce65abbaffa87604b0bbe52c9e290fe
1 # This example shows a bar graph, which starts with
2 # a stacked bar skipping to plot the original bar.
3 # This is done by using stackedbarpos before plotting
4 # a bar with the bar style. However you can still add
5 # errorbars, even to the lower bound of the bar.
6 # This example also shows how to handle several errorbars
7 # in one plot command by the usenames argument of the
8 # range style.
10 from random import random
11 from pyx import *
13 g = graph.graphxy(width=8, x=graph.axis.bar())
14 g.plot(graph.data.file("bar.dat", xname=0, y=2, stack=3,
15 dy="1+random()", dstack="1+random()",
16 context={"random": random}),
17 [graph.style.errorbar(),
18 graph.style.stackedbarpos("stack"),
19 graph.style.bar([color.rgb.green]),
20 graph.style.range({"y": "stack"}),
21 graph.style.errorbar()])
22 g.writeEPSfile("errors")
23 g.writePDFfile("errors")