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

Is drawn beneath the mesh.

Because CONTOUR does not handle irregularly spaced data, this

routine only works for surfaces defined on a rectangular grid.

The matrices or vectors X and Y define the axis limits only.

See also mesh, meshz.

<meshz> - 3-D mesh with curtain.

MESHZ 3-D mesh with curtain.

MESHZ(...) is the same as MESH(...) except that a "curtain" or

reference plane is drawn beneath.

This routine only works for surfaces defined on a rectangular

grid. The matrices X and Y define the axis limits only.

See also mesh, meshc.

<pie3> - 3-D pie chart.

PIE3 3-D pie chart.

PIE3(X) draws a 3-D pie plot of the data in the vector X. The

Values in X are normalized via X/sum(X) to determine the area of

each slice of pie. If SUM(X) <= 1.0, the values in X directly

specify the area of the pie slices. Only a partial pie will be

drawn if SUM(X) < 1.

PIE3(X,EXPLODE) is used to specify slices that should be pulled out

from the pie. The vector EXPLODE must be the same size as X. The

slices where EXPLODE is non-zero will be pulled out.

PIE3(...,LABELS) is used to label each pie slice with cell array

LABELS. LABELS must be the same size as X and can only contain

strings.

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

H = PIE3(...) returns a vector containing patch, surface, and text

handles.

Example

pie3([2 4 3 5],[0 1 1 0],{'North','South','East','West'})

See also pie.

Reference page in Help browser

doc pie3

<ribbon> - Draw 2-D lines as ribbons in 3-D.

RIBBON Draw 2-D lines as ribbons in 3-D.

RIBBON(X,Y) is the same as PLOT(X,Y) except that the columns of

Y are plotted as separated ribbons in 3-D. RIBBON(Y) uses the

default value of X=1:SIZE(Y,1).

RIBBON(X,Y,WIDTH) specifies the width of the ribbons to be

WIDTH. The default value is WIDTH = 0.75;

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

H = RIBBON(...) returns a vector of handles to surface objects.

See also plot.

Reference page in Help browser

doc ribbon

<scatter3> - 3-D scatter plot.

SCATTER3 3-D Scatter plot.

SCATTER3(X,Y,Z,S,C) displays colored circles at the locations

specified by the vectors X,Y,Z (which must all be the same size). The

area of each marker is determined by the values in the vector S (in

points^2) and the colors of each marker are based on the values in C. S

can be a scalar, in which case all the markers are drawn the same

size, or a vector the same length as X,Y, and Z.

When C is a vector the same length as X,Y, and Z, the values in C

are linearly mapped to the colors in the current colormap.

When C is a LENGTH(X)-by-3 matrix, the values in C specify the

colors of the markers as RGB values. C can also be a color string.

SCATTER3(X,Y,Z) draws the markers with the default size and color.

SCATTER3(X,Y,Z,S) draws the markers with a single color.

SCATTER3(...,M) uses the marker M instead of 'o'.

SCATTER3(...,'filled') fills the markers.

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

H = SCATTER3(...) returns handles to scatter objects created.

Use PLOT3 for single color, single marker size 3-D scatter plots.

Example

[x,y,z] = sphere(16);

X = [x(:)*.5 x(:)*.75 x(:)];

Y = [y(:)*.5 y(:)*.75 y(:)];

Z = [z(:)*.5 z(:)*.75 z(:)];

S = repmat([1 .75 .5]*10,numel(x),1);

C = repmat([1 2 3],numel(x),1);

scatter3(X(:),Y(:),Z(:),S(:),C(:),'filled'), view(-60,60)

See also scatter, plot3.

Reference page in Help browser

doc scatter3

<stem3> - 3-D stem plot.

STEM3 3-D stem plot.

STEM3(Z) plots the discrete surface Z as stems from the xy-plane

terminated with circles for the data value.

STEM3(X,Y,Z) plots the surface Z at the values specified

in X and Y.

STEM3(...,'filled') produces a stem plot with filled markers.

STEM3(...,LINESPEC) uses the linetype specified for the stems and

markers. See PLOT for possibilities.

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

H = STEM3(...) returns a stem object.

See also stem, quiver3.

Reference page in Help browser

doc stem3

<surfc> - Combination surf/contour plot.

SURFC Combination surf/contour plot.

SURFC(...) is the same as SURF(...) except that a contour plot

is drawn beneath the surface.

See also surf, shading.

<trisurf> - Triangular surface plot.

TRISURF Triangular surface plot

TRISURF(TRI,X,Y,Z,C) displays the triangles defined in the M-by-3

face matrix TRI as a surface. A row of TRI contains indexes into

the X,Y, and Z vertex vectors to define a single triangular face.

The color is defined by the vector C.

TRISURF(TRI,X,Y,Z) uses C = Z, so color is proportional to surface

height.

TRISURF(TR) displays the triangles in a TriRep - a Triangulation

representation. It uses C = TR.X(:,3), to color the

surface proportional to height.

H = TRISURF(...) returns a patch handle.

TRISURF(...,'param','value','param','value'...) allows additional

patch param/value pairs to be used when creating the patch object.

Example:

[x,y]=meshgrid(1:15,1:15);

tri = delaunay(x,y);

z = peaks(15);

trisurf(tri,x,y,z)

% Alternatively, if the surface is in the form of a TriRep,

% a triangulation representation, it may be plotted as follows;

tr = TriRep(tri, x(:), y(:), z(:));

trisurf(tr)

See also patch, trimesh, delaunay, TriRep, DelaunayTri.

Reference page in Help browser

doc trisurf

<trimesh> - Triangular mesh plot.

TRIMESH Triangular mesh plot

TRIMESH(TRI,X,Y,Z,C) displays the triangles defined in the M-by-3

face matrix TRI as a mesh. A row of TRI contains indexes into

the X,Y, and Z vertex vectors to define a single triangular face.

The edge color is defined by the vector C.

TRIMESH(TRI,X,Y,Z) uses C = Z, so color is proportional to surface

height.

TRIMESH(TRI,X,Y) displays the triangles in a 2-d plot.

TRIMESH(TR) displays the triangles in a TriRep - a Triangulation

representation.

H = TRIMESH(...) returns a handle to the displayed triangles.

TRIMESH(...,'param','value','param','value'...) allows additional

patch param/value pairs to be used when creating the patch object.

Example:

[x,y] = meshgrid(1:15,1:15);

tri = delaunay(x,y);

z = peaks(15);

trimesh(tri,x,y,z)

% Alternatively, if the surface is in the form of a TriRep

% a triangulation representation it may be plotted as follows;

tr = TriRep(tri, x(:), y(:), z(:))

trimesh(tr)

See also patch, trisurf, delaunay, DelaunayTri, TriRep.

Reference page in Help browser

doc trimesh

<waterfall> - Waterfall plot.

WATERFALL Waterfall plot.

WATERFALL(...) is the same as MESH(...) except that the column lines of

the mesh are not drawn - thus producing a "waterfall" plot. For

column-oriented data analysis, use WATERFALL(Z') or

WATERFALL(X',Y',Z').

See also mesh.

Reference page in Help browser

doc waterfall

Volume and vector visualization

<vissuite> - Visualization suite.

Visualization Suite.

Scalar Data.

isosurface - Isosurface extractor.

isonormals - Isosurface normals.

isocaps - Isosurface end caps.

contourslice - Contours in slice planes.

isocolors - Isosurface and patch colors.

Vector Data.

streamline - Streamlines from 2D or 3D vector data.

stream2 - 2D streamlines.

stream3 - 3D streamlines.

divergence - Divergence of a vector field.

curl - Curl and angular velocity of a vector field.

coneplot - 3D cone plot.

streamtube - 3D stream tube.

streamribbon - 3D stream ribbon.

streamslice - Streamlines in slice planes.

streamparticles - Display stream particles.

interpstreamspeed - Interpolate streamline vertices from speed.

Utilities.

subvolume - Extract subset of volume dataset.

reducevolume - Reduce volume dataset.

volumebounds - Returns x,y,z and color limits for volume data.

smooth3 - Smooth 3D data.

reducepatch - Reduce number of patch faces.

shrinkfaces - Reduce size of patch faces.

surf2patch - Convert surface data to patch data.

See also graph3d, specgraph.

<isosurface> - Isosurface extractor.

ISOSURFACE Isosurface extractor.

FV = ISOSURFACE(X,Y,Z,V,ISOVALUE) computes isosurface geometry for

data V at isosurface value ISOVALUE. Arrays (X,Y,Z) specify the points

at which the data V is given. The struct FV contains the faces and

vertices of the isosurface and can be passed directly to the PATCH

command.

FV = ISOSURFACE(V,ISOVALUE) assumes [X Y Z] = meshgrid(1:N, 1:M, 1:P)

where [M,N,P]=SIZE(V).

FV = ISOSURFACE(X,Y,Z,V) or FV = ISOSURFACE(V) selects an

isosurface value automatically using the histogram of the

data.

FVC = ISOSURFACE(..., COLORS) interpolates the array COLORS onto

the scalar field and returns the interpolated values in

facevertexcdata. The size of the COLORS array must be the same

as V.

FV = ISOSURFACE(..., 'noshare') does not attempt to create

shared vertices. This is faster, but produces a larger set of

vertices.

FV = ISOSURFACE(..., 'verbose') prints progress messages to the

command window as the computation progresses.

[F, V] = ISOSURFACE(...) or [F, V, C] = ISOSURFACE(...)

returns the faces and vertices (and facevertexcdata) in

separate arrays instead of a struct.

ISOSURFACE(...) With no output arguments, a patch is created

into the current axes with the computed faces and vertices.

If no current axes exists, a new axes will be created with

a 3-D view and appropriate lighting.

Example 1:

[x y z v] = flow;

p = patch(isosurface(x, y, z, v, -3));

isonormals(x,y,z,v, p)

set(p, 'FaceColor', 'red', 'EdgeColor', 'none');

daspect([1 1 1])

view(3)

camlight; lighting phong

Example 2:

[x y z v] = flow;

q = z./x.*y.^3;

p = patch(isosurface(x, y, z, q, -.08, v));

isonormals(x,y,z,q, p)

set(p, 'FaceColor', 'interp', 'EdgeColor', 'none');

daspect([1 1 1]); axis tight;

colormap(prism(28))

camup([1 0 0 ]); campos([25 -55 5])

camlight; lighting phong

See also isonormals, isocaps, smooth3, subvolume, reducevolume,

reducepatch, shrinkfaces.

Reference page in Help browser

doc isosurface

<isonormals> - Isosurface normals.

ISONORMALS Isosurface normals.

N = ISONORMALS(X,Y,Z,V,VERTICES) computes the normals of isosurface

vertices VERTICES by using the gradient of the data V. Arrays X, Y and Z

specify the points at which the data V is given. The normals are

returned in N. By default, the normals point in the direction of

smaller data values.

N = ISONORMALS(V,VERTICES) assumes [X Y Z] = meshgrid(1:N, 1:M, 1:P)

where [M,N,P]=SIZE(V).

N = ISONORMALS(V,P) or N = ISONORMALS(X,Y,Z,V,P) uses the vertices

from patch P.

N = ISONORMALS(..., 'negate') negates the computed normals.

ISONORMALS(V,P) or ISONORMALS(X,Y,Z,V,P) sets the 'VertexNormals'

property of the patch specified in P with the computed normals.

Example:

data = cat(3, [0 .2 0; 0 .3 0; 0 0 0], ...

[.1 .2 0; 0 1 0; .2 .7 0],...

[0 .4 .2; .2 .4 0;.1 .1 0]);

data = interp3(data,3, 'cubic');

subplot(1,2,1)

p = patch(isosurface(data, .5), 'FaceColor', 'red', 'EdgeColor', 'none');

view(3); daspect([1 1 1]);axis tight

camlight; camlight(-80,-10); lighting p;

title('Triangle Normals')

subplot(1,2,2)

p = patch(isosurface(data, .5), 'FaceColor', 'red', 'EdgeColor', 'none');

isonormals(data,p)

view(3); daspect([1 1 1]); axis tight

camlight; camlight(-80,-10); lighting phong;

title('Data Normals')

See also isosurface, isocaps, smooth3, subvolume, reducevolume,

reducepatch.

Reference page in Help browser

doc isonormals

<isocaps> - Isosurface end caps.

ISOCAPS Isosurface end caps.

FVC = ISOCAPS(X,Y,Z,V,ISOVALUE) computes isosurface end cap geometry

for data V at isosurface value ISOVALUE. Arrays X, Y and Z specify the

points at which the data V is given. The struct FVC contains the

faces, vertices and colors of the end caps and can be passed directly

to the PATCH command.

FVC = ISOCAPS(V,ISOVALUE) assumes [X Y Z] = meshgrid(1:N, 1:M, 1:P)

where [M,N,P]=SIZE(V).

FVC = ISOCAPS(X,Y,Z,V) or FVC = ISOCAPS(V) selects an isosurface

value automatically using the histogram of the data.

FVC = ISOCAPS(..., ENCLOSE) ENCLOSE describes if the end caps

enclose data values above or below ISOVALUE. ENCLOSE can be 'above'

(default) or 'below'.

FVC = ISOPCAPS(..., WHICHPLANE) WHICHPLANE describes on which plane

or planes the end caps will be drawn. WHICHPLANE is one of 'all'

(default), 'xmin', 'xmax', 'ymin', 'ymax', 'zmin', or 'zmax'.

[F, V, C] = ISOCAPS(...) returns the faces, vertices and colors in

three arrays instead of a struct.

ISOCAPS(...) With no output arguments, a patch is created with the

computed faces, vertices and colors.

Example:

load mri

D = squeeze(D);

D(:,1:60,:) = [];

p = patch(isosurface(D, 5), 'FaceColor', 'red', 'EdgeColor', 'none');

p2 = patch(isocaps(D, 5), 'FaceColor', 'interp', 'EdgeColor', 'none');

view(3); axis tight; daspect([1 1 .4])

colormap(gray(100))

camlight; lighting gouraud

isonormals(D, p);

See also isosurface, isonormals, smooth3, subvolume, reducevolume,

reducepatch.

Reference page in Help browser

doc isocaps

<isocolors> - Isosurface and patch colors.

ISOCOLORS Isosurface and patch colors.

NC = ISOCOLORS(X,Y,Z,C,VERTICES) computes the colors of

isosurface (patch) vertices VERTICES by using color values C.

Arrays X,Y,Z specify the points at which the data C is given.

X,Y,Z define the coordinates for C and must be monotonic

vectors or 3D plaid arrays (as if produced by MESHGRID). The

colors are returned in NC. C must be 3D (index colors).

NC = ISOCOLORS(X,Y,Z,R,G,B,VERTICES) uses R,G,B red, green, and

blue color arrays.

NC = ISOCOLORS(C,VERTICES) or NC = ISOCOLORS(R,G,B,VERTICES)

assumes [X Y Z]=meshgrid(1:N, 1:M, 1:P) where [M,N,P]=SIZE(C).

NC = ISOCOLORS(C,P), NC = ISOCOLORS(X,Y,Z,C,P),

NC = ISOCOLORS(R,G,B,P), or NC = ISOCOLORS(X,Y,Z,R,G,B,P) uses

the vertices from patch P.

ISOCOLORS(C,P), ISOCOLORS(X,Y,Z,C,P), ISOCOLORS(R,G,B,P), or

ISOCOLORS(X,Y,Z,R,G,B,P) sets the 'FaceVertexCdata'

property of the patch specified in P with the computed colors.

Example 1:

[x y z] = meshgrid(1:20, 1:20, 1:20);

data = sqrt(x.^2 + y.^2 + z.^2);

cdata = smooth3(rand(size(data)), 'box', 7);

p = patch(isosurface(x,y,z,data, 10));

isonormals(x,y,z,data,p);

isocolors(x,y,z,cdata,p);

set(p, 'FaceColor', 'interp', 'EdgeColor', 'none')

view(150,30); daspect([1 1 1]);axis tight

camlight; lighting p;

Example 2:

[x y z] = meshgrid(1:20, 1:20, 1:20);

data = sqrt(x.^2 + y.^2 + z.^2);

p = patch(isosurface(x,y,z,data, 20));

isonormals(x,y,z,data,p);

[r g b] = meshgrid(20:-1:1, 1:20, 1:20);

isocolors(x,y,z,r/20,g/20,b/20,p);

set(p, 'FaceColor', 'interp', 'EdgeColor', 'none')

view(150,30); daspect([1 1 1]);

camlight; lighting p;

Example 3:

[x y z] = meshgrid(1:20, 1:20, 1:20);

data = sqrt(x.^2 + y.^2 + z.^2);

p = patch(isosurface(data, 20));

isonormals(data,p);

[r g b] = meshgrid(20:-1:1, 1:20, 1:20);

c=isocolors(r/20,g/20,b/20,p);

set(p, 'FaceVertexCdata', 1-c)

set(p, 'FaceColor', 'interp', 'EdgeColor', 'none')

view(150,30); daspect([1 1 1]);

camlight; lighting p;

See also isosurface, isocaps, smooth3, subvolume, reducevolume,

reducepatch, isonormals.

Reference page in Help browser

doc isocolors

<contourslice> - Contours in slice planes.

CONTOURSLICE Contours in slice planes.

CONTOURSLICE(X, Y, Z, V, Sx, Sy, Sz) draws contours in axis aligned x, y, z

planes at the points in the vectors Sx, Sy, Sz. The arrays X, Y, Z define

the coordinates for V and must be monotonic and 3-D plaid (as if

produced by MESHGRID). The color at each contour will be determined

by the volume V. V must be an M-by-N-by-P volume array.

CONTOURSLICE(X, Y, Z, V, XI, YI, ZI) draws contours through the volume V

along the surface defined by the arrays XI, YI, ZI.

CONTOURSLICE(V, Sx, Sy, Sz) or CONTOURSLICE(V, XI, YI, ZI) assumes

[X, Y, Z] = meshgrid(1 : N, 1 : M, 1 : P) where [M, N, P] = SIZE(V).

CONTOURSLICE(..., N) draw N contour lines per plane, overriding the

automatic value.

CONTOURSLICE(..., CVALS) draws LENGTH(CVALS) contour lines per plane

at the values specified in vector CVALS.

CONTOURSLICE(..., [cv, cv]) computes a single contour per plane at the

level cv.

CONTOURSLICE(..., 'method') specifies the interpolation method to use.

'method' can be 'linear', 'cubic', or 'nearest'. 'nearest' is the

default except when the contours are being drawn along the

surface defined XI, YI, ZI when 'linear' is the default (see INTERP3).

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

H = CONTOURSLICE(...) returns a vector of handles to PATCH

objects in H.

Example:

[x, y, z, v] = flow;

h = contourslice(x, y, z, v, [1 : 9], [], [0], linspace(-8, 2, 10));

axis([0, 10, -3, 3, -3, 3]); daspect([1, 1, 1]);

camva(24); camproj perspective;

campos([-3, -15, 5]);

set(gcf, 'Color', [.3, .3, .3], 'renderer', 'zbuffer');

set(gca, 'Color', 'black', 'XColor', 'white', ...

'YColor', 'white', 'ZColor', 'white');

box on;

See also isosurface, smooth3, subvolume, reducevolume.

Reference page in Help browser

doc contourslice

<slice> - Volumetric slice plot.

SLICE Volumetric slice plot.

SLICE(X,Y,Z,V,Sx,Sy,Sz) draws slices along the x,y,z directions at

the points in the vectors Sx,Sy,Sz. The arrays X,Y,Z define the

coordinates for V and must be monotonic and 3-D plaid (as if

produced by MESHGRID). The color at each point will be determined

by 3-D interpolation into the volume V. V must be an M-by-N-by-P

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