Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Скачиваний:
19
Добавлен:
09.02.2015
Размер:
297.47 Кб
Скачать

matlab\graph3d – Трехмерные графики

Elementary 3-D plots

<plot3> - Plot lines and points in 3-D space.

PLOT3 Plot lines and points in 3-D space.

PLOT3() is a three-dimensional analogue of PLOT().

PLOT3(x,y,z), where x, y and z are three vectors of the same length,

plots a line in 3-space through the points whose coordinates are the

elements of x, y and z.

PLOT3(X,Y,Z), where X, Y and Z are three matrices of the same size,

plots several lines obtained from the columns of X, Y and Z.

Various line types, plot symbols and colors may be obtained with

PLOT3(X,Y,Z,s) where s is a 1, 2 or 3 character string made from

the characters listed under the PLOT command.

PLOT3(x1,y1,z1,s1,x2,y2,z2,s2,x3,y3,z3,s3,...) combines the plots

defined by the (x,y,z,s) fourtuples, where the x's, y's and z's are

vectors or matrices and the s's are strings.

Example: A helix:

t = 0:pi/50:10*pi;

plot3(sin(t),cos(t),t);

PLOT3 returns a column vector of handles to lineseries objects, one

handle per line. The X,Y,Z triples, or X,Y,Z,S quads, can be

followed by parameter/value pairs to specify additional

properties of the lines.

See also plot, line, axis, view, mesh, surf.

Reference page in Help browser

doc plot3

<mesh> - 3-D mesh surface.

MESH 3-D mesh surface.

MESH(X,Y,Z,C) plots the colored parametric mesh defined by

four matrix arguments. The view point is specified by VIEW.

The axis labels are determined by the range of X, Y and Z,

or by the current setting of AXIS. The color scaling is determined

by the range of C, or by the current setting of CAXIS. The scaled

color values are used as indices into the current COLORMAP.

MESH(X,Y,Z) uses C = Z, so color is proportional to mesh height.

MESH(x,y,Z) and MESH(x,y,Z,C), with two vector arguments replacing

the first two matrix arguments, must have length(x) = n and

length(y) = m where [m,n] = size(Z). In this case, the vertices

of the mesh lines are the triples (x(j), y(i), Z(i,j)).

Note that x corresponds to the columns of Z and y corresponds to

the rows.

MESH(Z) and MESH(Z,C) use x = 1:n and y = 1:m. In this case,

the height, Z, is a single-valued function, defined over a

geometrically rectangular grid.

MESH(...,'PropertyName',PropertyValue,...) sets the value of

the specified surface property. Multiple property values can be set

with a single statement.

MESH(AX,...) plots into AX instead of GCA.

MESH returns a handle to a surface plot object.

AXIS, CAXIS, COLORMAP, HOLD, SHADING, HIDDEN and VIEW set figure,

axes, and surface properties which affect the display of the mesh.

See also surf, meshc, meshz, waterfall.

Reference page in Help browser

doc mesh

<surf> - 3-D colored surface.

SURF 3-D colored surface.

SURF(X,Y,Z,C) plots the colored parametric surface defined by

four matrix arguments. The view point is specified by VIEW.

The axis labels are determined by the range of X, Y and Z,

or by the current setting of AXIS. The color scaling is determined

by the range of C, or by the current setting of CAXIS. The scaled

color values are used as indices into the current COLORMAP.

The shading model is set by SHADING.

SURF(X,Y,Z) uses C = Z, so color is proportional to surface height.

SURF(x,y,Z) and SURF(x,y,Z,C), with two vector arguments replacing

the first two matrix arguments, must have length(x) = n and

length(y) = m where [m,n] = size(Z). In this case, the vertices

of the surface patches are the triples (x(j), y(i), Z(i,j)).

Note that x corresponds to the columns of Z and y corresponds to

the rows.

SURF(Z) and SURF(Z,C) use x = 1:n and y = 1:m. In this case,

the height, Z, is a single-valued function, defined over a

geometrically rectangular grid.

SURF(...,'PropertyName',PropertyValue,...) sets the value of the

specified surface property. Multiple property values can be set

with a single statement.

SURF(AX,...) plots into AX instead of GCA.

SURF returns a handle to a surface plot object.

AXIS, CAXIS, COLORMAP, HOLD, SHADING and VIEW set figure, axes, and

surface properties which affect the display of the surface.

See also surfc, surfl, mesh, shading.

Overloaded methods:

sweepset/surf

Reference page in Help browser

doc surf

<fill3> - Filled 3-D polygons.

FILL3 Filled 3-D polygons.

FILL3(X,Y,Z,C) fills the 3-D polygon defined by vectors X, Y and Z

with the color specified by C. The vertices of the polygon

are specified by triples of components of X, Y and Z. If necessary,

the polygon is closed by connecting the last vertex to the first.

If C is a single character string chosen from the list 'r','g','b',

'c','m','y','w','k', or an RGB row vector triple, [r g b], the

polygon is filled with the constant specified color.

If C is a vector the same length as X, Y and Z, its elements are

scaled by CAXIS and used as indices into the current COLORMAP to

specify colors at the vertices; the color within the polygon is

obtained by bilinear interpolation in the vertex colors.

If X, Y and Z are matrices the same size, one polygon per column

is drawn. In this case, C is a row vector for "flat" polygon

colors, and C is a matrix for "interpolated" polygon colors.

If any of X, Y or Z is a matrix, and the others are column vectors

with the same number of rows, the column vector arguments are

replicated to produce matrices of the required size.

FILL3(X1,Y1,Z1,C1,X2,Y2,Z2,C2,...) is another way of specifying

multiple filled areas.

FILL3 sets the PATCH object FaceColor property to 'flat', 'interp',

or a colorspec depending upon the value of the C matrix.

FILL3 returns a column vector of handles to PATCH objects, one handle

per patch. The X,Y,Z,C quads can be followed by parameter/value pairs

to specify additional properties of the patches.

See also patch, fill, colormap, shading.

Reference page in Help browser

doc fill3

Color control

<colormap> - Color look-up table.

COLORMAP Color look-up table.

COLORMAP(MAP) sets the current figure's colormap to MAP.

COLORMAP('default') sets the current figure's colormap to

the root's default, whose setting is JET.

MAP = COLORMAP retrieves the current colormap. The values

are in the range from 0 to 1.

COLORMAP(AX,...) uses the figure corresponding to axes AX

instead of the current figure.

A color map matrix may have any number of rows, but it must have

exactly 3 columns. Each row is interpreted as a color, with the

first element specifying the intensity of red light, the second

green, and the third blue. Color intensity can be specified on the

interval 0.0 to 1.0.

For example, [0 0 0] is black, [1 1 1] is white,

[1 0 0] is pure red, [.5 .5 .5] is gray, and

[127/255 1 212/255] is aquamarine.

Graphics objects that use pseudocolor -- SURFACE and PATCH objects,

which are created by the functions MESH, SURF, and PCOLOR -- map

a color matrix, C, whose values are in the range [Cmin, Cmax],

to an array of indices, k, in the range [1, m].

The values of Cmin and Cmax are either min(min(C)) and max(max(C)),

or are specified by CAXIS. The mapping is linear, with Cmin

mapping to index 1 and Cmax mapping to index m. The indices are

then used with the colormap to determine the color associated

with each matrix element. See CAXIS for details.

Type HELP GRAPH3D to see a number of useful colormaps.

COLORMAP is a function that sets the Colormap property of a figure.

See also hsv, caxis, spinmap, brighten, rgbplot, figure, colormapeditor.

Reference page in Help browser

doc colormap

<caxis> - Pseudocolor axis scaling.

CAXIS Pseudocolor axis scaling.

CAXIS(V), where V is the two element vector [cmin cmax], sets manual

scaling of pseudocolor for the SURFACE and PATCH objects created by

commands like MESH, PCOLOR, and SURF. cmin and cmax are assigned

to the first and last colors in the current colormap. Colors for PCOLOR

and SURF are determined by table lookup within this range. Values

outside the range are clamped to the first or last colormap color.

CAXIS('manual') fixes axis scaling at the current range.

CAXIS('auto') sets axis scaling back to autoranging.

CAXIS, by itself, returns the two element row vector containing the

[cmin cmax] currently in effect.

CAXIS(AX,...) uses axes AX instead of the current axes.

CAXIS is a function that sets the axes properties CLim and CLimMode.

See also colormap, axes, axis.

Reference page in Help browser

doc caxis

<shading> - Color shading mode.

SHADING Color shading mode.

SHADING controls the Color shading of SURFACE and PATCH objects.

SURFACE and PATCH objects are created by the functions SURF, MESH,

PColor, FILL, and FILL3.

SHADING FLAT sets the shading of the current graph to flat.

SHADING INTERP sets the shading to interpolated.

SHADING FACETED sets the shading to faceted, which is the default.

Flat shading is piecewise constant; each mesh line segment or

surface patch has a constant Color determined by the Color value

at the end point of the segment or the corner of the patch which

has the smallest index or indices.

Соседние файлы в папке Библиотеки Matlab