From: Marko V. <ma...@ce...> - 2004-06-30 13:03:16
|
Hi! I am wondering whether it is possible not to fill graph.style.bar (or other objects), but use hatching? Should it be some kind of deco.hatch style? cheers, marko |
From: Andre W. <wo...@us...> - 2004-06-30 13:14:30
|
Hi, On 30.06.04, Marko Vendelin wrote: > I am wondering whether it is possible not to fill graph.style.bar (or > other objects), but use hatching? Should it be some kind of deco.hatch > style? In order to do so, you have to define a fill pattern and use it as a fill attribute. An example (for filling a rectangle): from pyx import * p = canvas.pattern() p.stroke(path.line(0, 0, 0.5, 0.5)) c = canvas.canvas() c.fill(path.rect(0, 0, 10, 10), [p]) c.writeEPSfile("pattern") We just don't have predefined patterns around ... André -- by _ _ _ Dr. André Wobst / \ \ / ) wo...@us..., http://www.wobsta.de/ / _ \ \/\/ / PyX - High quality PostScript figures with Python & TeX (_/ \_)_/\_/ visit http://pyx.sourceforge.net/ |
From: Joerg L. <jo...@us...> - 2004-06-30 14:02:01
|
Hi Marko, On 30.06.04, Marko Vendelin wrote: > I am wondering whether it is possible not to fill graph.style.bar (or > other objects), but use hatching? Should it be some kind of deco.hatch > style? You can do this using the pattern class in the canvas module. However, at the moment, there are no predefined patterns, so you have to generate one by yourself. Fortunately, this is rather easy: from pyx import * c = canvas.canvas() hatched = canvas.pattern() hatched.set([style.linewidth.thin]) hatched.stroke(path.line(0, 0, 0.25, 0.25)) c.draw(path.circle(0, 0, 5), [deco.filled([hatched]), deco.stroked]) c.writeEPSfile("hatched") Applying this to the case of bar plots should be straightforward. Jörg |