www.gusucode.com > graphics 案例源码程序 matlab代码 > graphics/ControlEdgeColorOfPolygonsExample.m

    %% Polygon Edges Without Faces
% Create a polygon with green edges and do not display the face. Then,
% create a second polygon with a different color for each edge.

% Copyright 2015 The MathWorks, Inc.


v = [0 0; 1 0; 1 1];
f = [1 2 3];
figure
patch('Faces',f,'Vertices',v,...
    'EdgeColor','green','FaceColor','none','LineWidth',2);


%%
% Use a different color for each edge by specifying a color for each vertex
% and setting |EdgeColor| to |'flat'|. 

v = [2 0; 3 0; 3 1];
f = [1 2 3];
c = [1 0 0; % red
    0 1 0; % green
    0 0 1]; % blue
patch('Faces',f,'Vertices',v,'FaceVertexCData',c,...
    'EdgeColor','flat','FaceColor','none','LineWidth',2);