Create one or more filled polygons

`patch(`

creates
one or more filled polygons using the elements of `X`

,`Y`

,`C`

)`X`

and `Y`

as
the coordinates for each vertex. `patch`

connects
the vertices in the order that you specify them. To create one polygon,
specify `X`

and `Y`

as vectors.
To create multiple polygons, specify `X`

and `Y`

as
matrices where each column corresponds to a polygon. `C`

determines
the polygon colors.

`patch('Faces',`

creates
one or more polygons where `F`

,'Vertices',`V`

)`V`

specifies vertex values
and `F`

defines which vertices to connect. Specifying
only unique vertices and their connection matrix can reduce the size
of the data when there are many polygons. Specify one vertex per row
in `V`

. To create one polygon, specify `F`

as
a vector. To create multiple polygons, specify `F`

as
a matrix with one row per polygon. Each face does not have to have
the same number of vertices. To specify different numbers of vertices,
pad `F`

with `NaN`

values.

`patch(___,`

creates
polygons and specifies one or more patch properties using name-value
pair arguments. A patch is the object that contains the data for all
of the polygons created. You can specify patch properties with any
of the input argument combinations in the previous syntaxes. For example, `Name,Value`

)`'LineWidth',2`

sets
the outline width for all of the polygons to 2 points.

`patch(`

creates
the patch in the axes specified by `ax`

,___)`ax`

instead of
in the current axes (`gca`

). The option `ax`

can
precede any of the input argument combinations in the previous syntaxes.

returns
the patch object that contains the data for all the polygons. Use `p`

= patch(___)`p`

to
query and modify properties of the patch object after it is created.
For a list of properties and descriptions, see Patch Properties.

Was this topic helpful?