fill3
Create filled 3-D patches
Syntax
fill3(X,Y,Z,C)
fill3(X1,Y1,Z1,C1,...,Xn,Yn,Zn,Cn)
fill3(___,Name,Value)
fill3(ax,___)
p = fill3(___)
Description
fill3(X,Y,Z,C)
plots filled polygonal regions on 3-D axes as Patch objects with vertices at the (
x
,
y
,
z
x,y,z
x,y,z) locations specified by X, Y, and Z.
- To plot one region, specify X, Y, and Z as vectors.
- To plot multiple regions, specify X, Y, and Z as matrices where each column corresponds to a polygon.
C determines the fill colors for the regions.
Specify vectors x, y, and z as the (x,y,z) coordinates of the vertices for a triangle. Then plot the triangle with the specified fill color, red.
x = [0 0 0]; y = [0 2 1]; z = [0 0 2]; fill3(x, y, z, 'r')
fill3(X1,Y1,Z1,C1,...,Xn,Yn,Zn,Cn)
plots multiple filled polygonal regions on the same 3-D axes.
Define vectors x1, y1, z1 and x2, y2, z2 as the (x,y,z) coordinates of the vertices for two rectangles. Specify the color of each rectangle as an RGB triplet, with values dictating the intensities of the red, green, and blue components of the color. Plot both rectangles in a single fill3 call.
x1 = [0 0 1 1]; y1 = [3 3 2 2]; z1 = [0 3 2 1]; c1 = [0 0.447 0.741]; x2 = [2 2 3 3]; y2 = [1 1 0 0]; z2 = [1 2 3 0]; c2 = [0.850 0.325 0.098]; fill3(x1, y1, z1, c1, x2, y2, z2, c2)
fill3(___,Name,Value)
modifies the Patch objects using one or more name-value arguments to set properties. Patches can be specified using any of the input argument combinations in previous syntaxes. For example, fill3(X,Y,Z,C,'LineWidth',2)
specifies a two-point border around all the patches. For a list of properties, see Patch Properties.
fill3(ax,___)
plots the polygonal regions in the axes specified by ax instead of in the current axes (gca).
p = fill3(___)
returns a Patch object or a vector of Patch objects. Use p to query and modify properties after plotting a region. For a full list of properties, see Patch Properties.
Specify matrices x, y, and z as the coordinates of the vertices for three adjacent squares. Specify c as a matrix of the same dimensions as x, y, and z. Each value in c specifies a colormap index for the corresponding vertex. The fill3 function interpolates the fill color of each square from the vertex colors.
x = [0 0 0; 0 0 2; 0 2 2; 0 2 0]; y = [2 0 2; 0 0 2; 0 0 0; 2 0 0]; z = [2 0 2; 2 2 2; 0 2 2; 0 0 2]; c = [2 2 2; 3 3 0; 2 2 2; 0 0 3]; fill3(x, y, z, c)