主要内容

充满3

Filled 3-D polygons

Syntax

Fill3(x,y,z,c)
充满3(X,Y,Z,ColorSpec)
充满3(X1,Y1,Z1,C1,X2,Y2,Z2,C2,...)
fill3(...,'propertyname',propertyValue)
充满3(ax,...)
h = fill3(...)

Description

The充满3function creates flat-shaded and Gouraud-shaded polygons.

Fill3(x,y,z,c)填充三维多边形。X,Y, 和Ztriplets specify the polygon vertices. IfX,Y, orZis a matrix,充满3创造npolygons, wherenis the number of columns in the matrix.充满3通过在必要时将最后一个顶点连接到第一个顶点来关闭多边形。价值X,Y, 和Zcan be numeric, datetime, duration, or categorical values.

C指定颜色,在哪里Cis a vector or matrix of indices into the current colormap. IfCis a row vector,length(C)must equalsize(X,2)尺寸(y,2); ifCis a column vector,length(C)must equalsize(X,1)尺寸(y,1).

充满3(X,Y,Z,ColorSpec)充满s the polygons with the color specified byColorSpec, which can be one of the following values:

  • A color name or a short name:'red'(or'r'),'green'(or'g'),'blue'(or'b'),'青色'(or'c'),'品红'(or'M'),'yellow'(or'y'),'black'(or'k'),'white'(or'w').

  • An RGB triplet specified as a 1-by-3 vector whose elements are the intensities of the red, green, and blue components of a color. The intensities must be in the range [0, 1]. For example,[0.7 0.8 1]specifies light blue.

充满3(X1,Y1,Z1,C1,X2,Y2,Z2,C2,...)specifies multiple filled three-dimensional areas.

fill3(...,'propertyname',propertyValue)allows you to set values for specific patch properties.

充满3(ax,...)创造the polygons in the axes specified byax而不是当前轴(gca). The optionax可以在前一个语法中之前在任何输入参数组合之前。

h = fill3(...)returns a vector of patch objects.

Examples

collapse all

Create four triangles with interpolated colors.

X = [0 1 1 2; 1 1 2 2; 0 0 1 1]; Y = [1 1 1 1; 1 0 1 0; 0 0 0 0]; Z = [1 1 1 1; 1 0 1 0; 0 0 0 0]; C = [0.5000 1.0000 1.0000 0.5000; 1.0000 0.5000 0.5000 0.1667; 0.3330 0.3330 0.5000 0.5000]; figure fill3(X,Y,Z,C)

算法

IfX,Y, 和Z是相同大小的矩阵,充满3从相应的元素中形成顶点X,Y, 和Z(all from the same matrix location), and creates one polygon from the data in each column.

IfX,Y, orZis a matrix,充满3replicates any column vector argument to produce matrices of the required size.

If you specify color using theColorSpec争论,充满3generates flat-shaded polygons and sets the patch objectFaceColorproperty to an RGB triplet.

If you specify color usingC,充满3缩放元素CLim通过轴属性CLim, which specifies the color axis scaling parameters, before indexing the current colormap.

IfCis a row vector,充满3generates flat-shaded polygons and sets theFaceColorproperty of the patch objects to'flat'. Each element becomes theCDataproperty value for the respective patch object.

IfCis a column vector or a matrix,充满3generates polygons with interpolated colors and sets the patch objectFaceColorproperty to'interp'.充满3使用一条线ar interpolation of the vertex colormap indices when generating polygons with interpolated colors. The elements in one column become theCDataproperty value for the respective patch object. IfCis a column vector,充满3复制列向量以产生所需的大小矩阵。

Extended Capabilities

在R2006A之前介绍