1 from pyx
import * # bar.dat looks like:
2 from pyx
.graph
import axis
# #month min max
5 # we prepare some stuff first ...
6 bap
= axis
.painter
.bar
# just an abbreviation
7 a1
= axis
.bar(painter
=bap(nameattrs
=None)) # for single bars
8 a2
= axis
.bar(painter
=bap(nameattrs
=[trafo
.rotate(45),
11 subaxis
=axis
.bar(dist
=0)) # for several bars
12 nofirst
= [attr
.changelist([None, color
.rgb
.green
])] # special draw attrs
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, ystack1
=3),
17 graph
.style
.bar(barattrs
=nofirst
))
18 g2
= c
.insert(graph
.graphxy(width
=8, x
=a2
, height
=4))
19 g2
.plot([graph
.data
.file("bar.dat", xname
=1, y
=2),
20 graph
.data
.file("bar.dat", xname
=1, y
=3)],