patch(X, Y, C)
patch(X, Y, Z, C)
patch('XData', X, 'YData', Y)
patch('XData', X, 'YData', Y, 'ZData', Z)
patch('Faces', F, 'Vertices', V)
patch(S)
patch(..., propertyName, propertyValue)
patch(ax, ...)
go = patch(...)
| Parameter | Description |
|---|---|
| X | x-coordinates: vector or matrix. |
| Y | y-coordinates: vector or matrix. |
| Z | z-coordinates: vector or matrix. |
| C | Color array: scalar, vector, m-by-n-by-3 array of RGB triplets. |
| ax | a scalar graphics object value: parent container, specified as a axes. |
| propertyName | a scalar string or row vector character. |
| propertyValue | a value. |
| S | a structure with fields that correspond patch property names and field values. |
| Parameter | Description |
|---|---|
| go | a graphics object: patch type. |
patch(X, Y, C) creates a 2D polygonal shape with vertices defined byX and Y coordinates, and fills the shape with colorC.
patch(X, Y, Z, C) creates a 3D polygonal shape with vertices defined byX, Y, andZ coordinates, and fills the shape with color C.
patch(..., PropertyName, PropertyValue, ...) sets optional properties for the patch object using name-value pairs.
patch('Faces', F, 'Vertices', V) creates one or more polygons .
go = patch(...) returns the handle go to the created patch object.
See patch properties for the complete property list.
fig = figure('Color', 'k');
ax = gca();
ax.Color = 'k';
f=0.1;
t=0:f^2:2*pi;
r=pi/4;
p=r*t+r;
patch([cos(p), 0], [sin(p), 0], 'y');
c = eye(3);
for a=2:2:6
patch([t/4+a, a+r*(1+cos(t/2)),a], [-f*cos(3*(a+t))-r,r*sin(t/2),-1], c(a/2,:));
patch(a +f*cos(t)'+r./[1,0.65], f*(2+sin(t)').*[1,1], 'k', 'EdgeColor', 'w', 'LineWidth', pi)
end
axis equal
axis off
f =figure('Color', 'w');
x = [-1 1 0 -1];
y = [-1/sqrt(3) -1/sqrt(3) 2*sqrt(3)/3 -1/sqrt(3)];
plot(x,y,'k','LineWidth',3);
t = 0:0.001:2*pi;
xc = cos(t)/3+x';
yc = sin(t)/3-y';
for i = 1:3
patch(xc(i,:),yc(i,:),'k');
end
patch(x,-y,'w','EdgeColor','w');
axis('equal')
axis('off')
nefertiti_directory = [modulepath('graphics', 'root'), '/examples/nefertiti-mask/'];
load([nefertiti_directory, 'nefertiti-mask.nh5']);
figure('Color', [1, 1, 1]);
patch('Faces', Faces, 'Vertices', Vertices, 'FaceVertexCData', Colors, ...
'EdgeColor', 'white', ...
'FaceColor', 'interp', 'FaceAlpha', 1);
axis equal
axis off
view([0, 0, 1]);
x = [1 3 4 3 1 0];
y = [0 0 2 4 4 2];
z = [0 0 0 0 0 0];
figure();
hold on
patch(x,y,z,'cyan','FaceAlpha',0.3)
patch(x+2,y,z,'magenta','FaceAlpha',0.3)
patch(x+1,y+2,z,'yellow','FaceAlpha',0.3)
| Version | Description |
|---|---|
| 1.0.0 | initial version |
| 1.7.0 | CreateFcn, DeleteFcn callback added. |
| -- | BeingDeleted property added. |