Graphics Reference
In-Depth Information
4.3 Special 3D Geometric Shapes
MATLAB provides commands to represent geometric shapes in three dimensions, such as cylinders, spheres, rods,
sections, stems, waterfall, etc. The syntax of these commands is presented in the following table:
bar3(Y)
Bar graph relative to the frequencies values vector Y. If a matrix it gets multiple bar
graphs for each row of Y.
bar3(x,Y)
Bar graph relative to the values vector Y where x is a vector that defines the spaces in
the x axis to locate bars.
bar3(…,width)
Graph with given width of the bars. By default, the width is 0.8 and a width of 1 causes
bars that touch.
bar3(…,'style')
Graph with the given style bars. The styles are 'detached' (default style) 'grouped'
(style with grouped vertical bars) and 'stacked' (stacked bars).
bar3(…,color)
The bars are all of the specified color (r = red, g = green, b = blue, c = cyan, m = magenta
y = yellow, k = black and w = white)
comet3(z)
comet3(x, y, z)
comet3(x, y, z, p)
Graph relative to the Comet vector z
Comet graph with parameters (x (t), y (t), z (t))
Comet graph of a kite with body of length p * length (y).
[X, Y, Z] = cylinder
[X, Y, Z] = cylinder(r)
[X,Y, Z] = cylinder(r, n)
cylinder(…)
It gives the coordinates of the unit cylinder.
It gives the coordinates of the cylinder generated by the curve r.
Gives the coordinates of the cylinder generated by the curve r with n points on the
circumference that align the horizontal section with the Z axis (n = 20 by default).
Graph previous cylinders.
sphere
Graph the unit sphere using 20 x 20 faces.
sphere(n)
Generates a sphere using n x n.
[X, Y, Z] = sphere(n)
Gives the coordinates of the sphere in three arrays (n + 1) x (n + 1).
slice(V,sx,sy,sz)
Draws slices along directions x, y and z in the volume V (array m x n x p) defined by the
vectors (sx, sy, sz).
Draws cuts defined by the vectors (sx, sy, sz) in the volume V, defined by the
three-dimensional arrays (X, Y, Z).
Draws cuts in volume V defined by (XI, YI, ZI) matrices that generate a surface.
Draws cuts defined by (XI, YI, ZI) matrices that generate a surface in the volume V,
defined by the three-dimensional arrays (X, Y, Z).
Draws cuts according to the specified method of interpolation (linear, cubic and nearest).
slice(X,Y,Z,V,sx,sy,sz)
slice(V,XI,YI,ZI)
slice(X,Y,Z,V,XI,YI,ZI)
slice(…,'method')
stem3(Z)
stem3(X,Y,Z)
stem3(…,'fill')
stem3(…,S)
Draws the sequence Z as a graph of stems in the plane (x, y).
Draws the sequence of values specified by X, Y and Z.
Fill color in the circles at the tips of the stems.
Makes stems utilize S specifications chart (color,…).
waterfall(X,Y,Z)
waterfall(Z)
waterfall(…,C)
Draws a cascade graph according to the values of X, Y, Z.
This means x = 1:size(Z,2) and y = 1:size(Z,1) .
Draws the cascade graph with colormap C.
quiver3(X,Y,Z,U,V,W)
Draws the vectors of components (u, v, w) in the points (x, y, z).
 
Search WWH ::




Custom Search