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
10 from random
import random
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")