From: Andre Wobst <wobsta@us...>  20040924 08:31:31

Hi, so lets make it complete, i.e. draw a border around the graph key. I started from the piaxis example: from math import pi from pyx import * from pyx.graph import axis class mykey(graph.key.key): def paint(self, plotitems): c = canvas.canvas() ci = graph.key.key.paint(self, plotitems) c.stroke(ci.bbox().enlarged(0.2).path(), [deco.filled([color.gray.white])]) c.insert(ci) return c g = graph.graphxy(width=8, key=mykey(pos="bl"), x=axis.linear(min=0, max=2*pi, title="$x$", divisor=pi, texter=axis.texter.rational(suffix=r"\pi")), y=axis.linear(title="$y$")) g.plot(graph.data.function("y=sin(x)", title=r"$\sin(x)$")) g.plot(graph.data.function("y=cos(x)", title=r"$\cos(x)$")) g.finish() g.stroke(g.ygridpath(0)) g.writeEPSfile("piaxis") Here I also filled the graph key area with white color. Currently it would be a bit difficult to make it really "transparent". However, I not sure whether this would be wanted for this case at all ... André PS: I don't understand why there is a path and a rect method in bbox. Jörg, Michael, any ideas?  by _ _ _ Dr. André Wobst / \ \ / ) wobsta@..., http://www.wobsta.de/ / _ \ \/\/ / PyX  High quality PostScript figures with Python & TeX (_/ \_)_/\_/ visit http://pyx.sourceforge.net/ 