Hi
I'm not sure if i'm hitting a limitation of matlab here, or if I'm actually missing something.
What i'm trying to do:
Suppose you have multiple measurement series with mean, max and min for each data point. To get a visual idea where the data lies, I plotted the individual series as patches (limited by min and max) on top of each other with a semitransparent color. This way, the the areas that are covered the most get colored the darkest. So far, so good, that all worked.
What is not working to my expectations:
I'd like to go one step further and plot the areas with a gradient, such that the mean values are dark, while min and max fade to full transparency. I have fiddeled with both the fill and patch functions (what's the difference between them anyway?), but have only succeeded in fading the color to white and setting an uniform alpha for the whole area. While this looks fine for a single measurement series, the white edges are visible when they crosss another series. This works against the readability of the whole thing.
Example
I have coded up a small example to visualize my problem. If you use the function "flat", you get the result without gradient, which is close to what i'm trying to achieve (the top two curves in the plot). If you use the function "withGradient", you can see the white edges of the top curve (the bottom two curves in the plot).
flat(x, 0.8 + sin(x ./ 16), spread, color);
flat(x, 1.3 - 0.01 * x, spread, color);
withGradient(x, -0.8 + sin(x ./ 16), spread, color);
withGradient(x, -0.3 - 0.01 * x, spread, color);
function flat(x, y, spread, color)
yy = [y + spread, flip(y - spread)]';
function withGradient(x, y, spread, color)
yy = [y + spread, flip(y), y - spread]';
S.Faces = [1:2*len; len+1:3*len];
S.FaceVertexCData = 1 - ((1:3*len > len & 1:3*len <= 2*len)' * (1 - color));
What was the question again?
Is there a way to have the opacity (alpha) interpolated from mean to min/max respectively?
Cheers
Manuel