Source code used to draw grid of transparency examples for "arrow" documentation

% Draw arrows to illustrate the use of Matlab's
% transparency ("alpha") settings for patch objects.

% Arrow "A" - Uniform transparency.  (Use 'FaceAlpha'.)
%           - Include rim.  (Use 'EdgeColor'.)
%           - Thicken rim.  (Use 'LineWidth'.)
davinci( 'arrow', 'X',             [  0  10], ...
                  'Y',             [  0   0], ...
                  'Shaft.Type',  'rectangle', ...
                  'Head.Length',           4, ...
                  'Head.Width',            5, ...
                  'Head.Sweep',            0, ...
                  'Shaft.Width',           2, ...
                  'FaceAlpha',           0.4, ...
                  'EdgeColor',           'k', ...
                  'LineWidth',             3 );
hold on

% Arrow "B" - Graded transparency.  (Use 'FaceAlpha' and 'FaceVertexAlphaData'.)
%           - Include rim.  (Use 'EdgeColor'.)
davinci( 'arrow', 'X',                   [13 23], ...
                  'Y',                   [ 0  0], ...
                  'Head.Length',               4, ...
                  'Head.Width',                5, ...
                  'Head.Sweep',                0, ...
                  'Shaft.Width',               2, ...
                  'FaceVertexAlphaData',       [ 0.6 0.7 1.0 0.7 0.6 0.6 1.0 ]', ... % Note the '.
                  'FaceAlpha',          'interp', ...
                  'EdgeColor',               'k' );

% Arrow "C" - Graded transparency makes arrow emerge from ether.  (Use 'FaceAlpha' and 'FaceVertexAlphaData'.)
davinci( 'arrow', 'X',                    [26 36], ...
                  'Y',                    [ 0  0], ...
                  'Head.Width',                 2, ...
                  'Head.Sweep',                 1, ...       
                  'Shaft.Width',                1, ...
                  'FaceVertexAlphaData',        [ 0.6 0.9 0.9 1.0 0.9 0.9 0.6 ]', ... % Note the '.
                  'FaceAlpha',           'interp' );

% Arrow "D" - Graded transparency.  (Use 'FaceAlpha' and 'FaceVertexAlphaData'.)
%           - Double arrow.
%           - Include rim.  (Use 'EdgeColor'.)
davinci( 'arrow', 'X',                    [ 0 10], ...
                  'Y',                    [-8 -8], ...
                  'ArrowType',           'double', ...
                  'Head.Length',                1, ...
                  'Head.Width',                 4, ...
                  'Head.Sweep',                 1, ...       
                  'Shaft.Width',                1, ...
                  'FaceVertexAlphaData',        [ 0.6 0.9 0.9 0.6 0.9 0.9 1.0 0.9 0.9 0.6 ]', ... % Note the '.
                  'FaceAlpha',           'interp', ...
                  'EdgeColor',                'k' );

% Arrow "E" - Graded transparency.  (Use 'FaceAlpha' and 'FaceVertexAlphaData'.)
%           - Double arrow.
%           - Diamond shape, so only 4 vertices need to be specified.
davinci( 'arrow', 'X',                    [13 15], ...
                  'Y',                    [-8 -8], ...
                  'ArrowType',           'double', ...
                  'Head.Length',                1, ...
                  'Head.Width',                 8, ...
                  'Shaft.Width',                8, ...
                  'FaceVertexAlphaData',        [ 1 0.5 1 0.5]', ... % Note the '.
                  'FaceAlpha',           'interp' );

% Arrow "F" - Graded transparency.  (Use 'FaceAlpha' and 'FaceVertexAlphaData'.)
%           - Double arrow.
davinci( 'arrow', 'X',                    [19 36], ...
                  'Y',                    [-8 -8], ...
                  'ArrowType',           'double', ...
                  'Head.Length',                3, ...
                  'Head.Width',                 5, ...
                  'Shaft.Width',                1, ...
                  'FaceVertexAlphaData',        [ 1 1 1 0.7 1 1 1 1 0.7 1 ]', ... % Note the '.
                  'FaceAlpha',           'interp' );

% Arrow "G" - Graded transparency.  (Use 'FaceAlpha' and 'FaceVertexAlphaData'.)
%           - Double arrow.
%           - Inverted shading on the two arrow heads.
davinci( 'arrow', 'X',                  [  0  10], ...
                  'Y',                  [-16 -16], ...
                  'ArrowType',           'double', ...
                  'Head.Length',                3, ...
                  'Head.Width',                 5, ...
                  'FaceVertexAlphaData',        [ 1 1 1 0.5 ]', ... % Note the '.
                  'FaceAlpha',           'interp' );

% Arrow "H" - Graded transparency.  (Use 'FaceAlpha' and 'FaceVertexAlphaData'.)
%           - Double arrow.
%           - Adjust arrow after it is drawn.  Put a red rim around one of the heads.
h = davinci( 'arrow', 'X',                  [ 13  36], ...
                      'Y',                  [-16 -16], ...
                      'ArrowType',           'double', ...
                      'Head.Length',                3, ...
                      'Head.Width',                 7, ...
                      'Head.Sweep',                 2, ...
                      'FaceVertexAlphaData',        [ .7 1 .7 1 ]', ... % Note the '.
                      'FaceAlpha',           'interp', ...
                      'LineWidth',                  1 );
% Include a red rim around the first arrow head.
h.head_1.set( 'EdgeColor', 'r' );

daspect( [1 1 1] )
hold off