patch
Create patches of colored polygons
Syntax
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(...)
Input argument
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.
Output argument
go - a graphics object: patch type.
Description
patch(X, Y, C) creates a 2D polygonal shape with vertices defined by X and Y coordinates, and fills the shape with color C.
patch(X, Y, Z, C) creates a 3D polygonal shape with vertices defined by X, Y, and Z 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.
Property Name-Value Pairs:
'FaceColor': color of the filled shape. FaceColor can be a character vector or a 3-element RGB vector. Default: 'flat'.
'EdgeColor': color of the edges of the polygonal shape. EdgeColor can be a character vector or a 3-element RGB vector. Default: 'none'.
'LineWidth': width of the edges of the polygonal shape. Default: 0.5.
'LineStyle': style of the edges of the polygonal shape. LineStyle can be a character vector or a line style code. Default: '-'.
'FaceAlpha': transparency of the filled shape. FaceAlpha can be a scalar between 0 and 1. Default: 1.
'EdgeAlpha': transparency of the edges of the polygonal shape. EdgeAlpha can be a scalar between 0 and 1. Default: 1.
'Parent': handle of the parent object for the patch. Default: gca().
'Vertices': matrix of vertex coordinates. The matrix must have size N-by-2 or N-by-3, where N is the number of vertices. Default: the vertex coordinates are specified by the X, Y, and Z input arguments.
CreateFcnCallback (function handle, string or cell) called when object is created. Set this property on an existing component has no effect.
DeleteFcnCallback (function handle, string or cell) called when object is deleted.
BeingDeleted Flag indicating that the object is being deleted.
Examples
Nerfertiti 3D mask
Alpha channel
See also
History
Version | Description |
---|---|
1.0.0 | initial version |
1.7.0 | CreateFcn, DeleteFcn callback added. |
-- | BeingDeleted property added. |
Author
Allan CORNET
Last updated