Hi there, if you want to stroke a path with a gradient you can use the colorgradient decorator like so:
from pyx import * c=canvas.canvas() c.stroke(path.line(0,0,1,1),[style.linewidth(1),deco.colorgradient(color.gradient.BlueRed)]) If you really want to fill (the interior of) a path I think you will have to fill a canvas with the gradient and clip that canvas by the path. (for a similar approach with patterns, see http://nbviewer.ipython.org/urls/sf.net/p/pyx/gallery/pattern/attachment/pattern.ipynb) For filling the canvas you can (ab)-use bitmaps. I seem to remember that "shadings" are the proper approach and that we talked about that before, but I can't find my own examples right now. Let's hope decorated paths do it for you :) Michael René Bastian venit, vidit, dixit 23.01.2016 18:01: > Le Sun, 24 Jan 2016 03:29:57 +1100, > Simon Burton <[email protected]> a écrit : > >> On Sat, 23 Jan 2016 17:02:31 +0100 >> René Bastian <[email protected]> wrote: >> >>> Le Sun, 24 Jan 2016 02:33:54 +1100, >>> Simon Burton <[email protected]> a écrit : >>> >>>> >>>> Hi Pyxers, >>>> >>>> is there a way to fill paths with a gradient, instead of a single >>>> colour? >>>> >>> cf. color.gradients in the manual p. 79 (86) >> >> Yes, I found this previously but I have no idea how to use it in a >> fill. >> > > Another ex: > > http://pyx.sourceforge.net/examples/3dgraphs/color.html >> >> Cheers, >> Simon. >> >> ------------------------------------------------------------------------------ >> Site24x7 APM Insight: Get Deep Visibility into Application Performance >> APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month >> Monitor end-to-end web transactions and take corrective actions now >> Troubleshoot faster and improve end-user experience. Signup Now! >> http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140 >> _______________________________________________ >> PyX-user mailing list >> [email protected] >> https://lists.sourceforge.net/lists/listinfo/pyx-user > > > ------------------------------------------------------------------------------ Site24x7 APM Insight: Get Deep Visibility into Application Performance APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month Monitor end-to-end web transactions and take corrective actions now Troubleshoot faster and improve end-user experience. Signup Now! http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140 _______________________________________________ PyX-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/pyx-user
