There are no explicit benchmarks per se, but you can easily do this as well. collect the collected points and divide them into "segments" (for example, using the buffer function)
b. setting the 'color' property for children (thanks to @Suever for indicating this can be done by an array of object descriptors directly )
%% Get spline curve x = [0.16; 0.15; 0.25; 0.48; 0.67]; y = [0.77; 0.55; 0.39; 0.22; 0.21]; spcv = cscvn ([x, y].'); %% Split into segments pts = fnplt (spcv); xpts = pts(1,:).'; ypts = pts(2,:).'; idx = buffer ([1 : length(xpts)]', 10, 1, 'nodelay'); % 10pt segments lastidx=idx(:,end); lastidx(lastidx==0)=[]; idx(:,end)=[]; % correct last segment % Plot segments plot (xpts(idx), ypts(idx), xpts(lastidx), ypts(lastidx), 'linewidth', 10); % Adjust colour and transparency Children = flipud (get (gca, 'children')); Colours = hsv (size (Children, 1)); % generate from colourmap Alphas = linspace (0, 1, length (Children)).'; % for example set (Children, {'color'}, num2cell([Colours, Alphas],2));

Note. As also indicated in the comments section ( thanks to @ Dev-iL ), setting the color to the RGBA square as you ask (i.e. unlike a simple RGB triple) is newer (also currently undocumented ). Matlab function. This code, for example. will not work in 2013.
source share