1 from pyx
import * # bar.dat looks like:
2 from pyx
.graph
import axis
# #month min max
6 # we prepare some stuff first
7 bap
= axis
.painter
.bar
# just an abbreviation
8 a1
= axis
.bar(painter
=bap(nameattrs
=None)) # for single bars
9 a2
= axis
.bar(painter
=bap(nameattrs
=[trafo
.rotate(45),
12 subaxis
=axis
.bar(dist
=0)) # for several bars
14 c
= canvas
.canvas() # we draw several plots, thus we create a main canvas
15 g
= c
.insert(graph
.graphxy(ypos
=4.5, width
=8, height
=4, x
=a1
))
16 g
.plot(graph
.data
.file("bar.dat", xname
=1, y
=2, stack
=3),
17 [graph
.style
.stackedbarpos("stack"),
18 graph
.style
.bar(barattrs
=[color
.rgb
.green
])])
19 g2
= c
.insert(graph
.graphxy(width
=8, x
=a2
, height
=4))
20 g2
.plot([graph
.data
.file("bar.dat", xname
=1, y
=2),
21 graph
.data
.file("bar.dat", xname
=1, y
=3)],