Screenshot instructions:
Windows
Mac
Red Hat Linux
Ubuntu
Click URL instructions:
Right-click on ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)
From: Joerg Lehmann <joergl@us...> - 2009-10-15 12:42:51
|
Hi Michael, On 15.10.09, Michael J Gruber wrote: > I know that one, but is style.linewidth() an instance of trafo.trafo, > canvas.clip, style.strokestyle or style.fillstyle? I tried anyways, and > it worked, of course, because of the way attrs are handed down. It's an instance of style.strokestyle. On 15.10.09, Michael J Gruber wrote: > from pyx import * >· > c = canvas.canvas() > c2 = canvas.canvas() >· > c.stroke(path.line(0,0,0,1)) > c2.stroke(path.line(1,0,1,1)) > c2.stroke(path.line(2,0,2,1), [style.linewidth(0.2)]) >· > c.insert(c2, [style.linewidth(0.4)]) >· > c.stroke(path.line(3,0,3,1)) > c2.stroke(path.line(4,0,4,1)) >· > c.writePDFfile(__file__[:-3]) >· > How many (even long time) users will get it right? Hey, but that should all be obvious :-) (i) Setting PS attributes is done via the usual PS operators encapsulated in a gsave/grestore pair. The "last" operator of course takes precedence. (ii) There are no copies what so ever involved, so it doesn't matter when - i.e. before or after inserting it - you modifiy the contents of a canvas. > I thought the line at 2 has width 0.4 (because of the order of > "assignments" of linewidths) and wasn't sure whether the one at 4 > would > appear. But I remembered experimenting once with the difference > between > inserting a canvas, a copy of a canvas and a *deep* copy of a canvas, > which explains this. As I said above, there is no copy happening at all! Best, Jörg |