I'm trying to get started making some more advanced plots with PyX. What I want to do is create a plot with some lines on it, where each line is surrounded by a half-transparent filled area (the 1-sigma deviation around the line). (For an example see http://governator.ucsc.edu/filer/p04tau100variance.png, which was made with matplotlib.)

The strategy I'm using is based on the "integral" example, ie:

plot lines
retrieve paths from plotitems
create closed paths and fill them

However, I'm running into some problems. The first is setting the color of the lines: I want the "main" lines to use a color gradient, and then I want to retrieve that color and use it again for the lines bounding the filled area. However, I can't figure out how to do this. The manual talks about various ways of setting the styles used for stroking the paths, but not how to retrieve them. I'm not even sure that this is part of the path derived from the plotitem, because it seems that the stroke style is set when passing the path to the canvas.stroke function and is not a property of the path itself?

The second problem is that it's my understanding that to get the paths out of the plot, you need to finish it. But then you can't plot to it again, so at that point it's too late to add the shaded region?

Any hints as to how to accomplish this would be much appreciated.


/Patrik J.