3-D Visualization
3-D Visualization
Create and manipulate graphics that display 2-D matrix and 3-D volume data,
controlling the view, lighting and transparency.
Category Description
Surface and Mesh Plots Plot matrices, visualize functions of two
variables, specify colormap
View Control Control the camera viewpoint, zooming,
rotation, aspect ratio, set axis limits
Lighting Add and control scene lighting
Transparency Specify and control object transparency
Volume Visualization Visualize gridded volume data
Surface and Mesh Plots
• Creating Surfaces and Meshes
• Domain Generation
• Color Operations
• Colormaps
Creating Surfaces and Meshes
hidden Mesh hidden line removal mode
meshc Combination mesh/contourplot
mesh 3-D mesh with reference plane
peaks A sample function of two variables
surf 3-D shaded surface graph
surface Create surface low-level objects
surfc Combination surf/contourplot
surfl 3-D shaded surface with lighting
tetramesh Tetrahedron mesh plot
trimesh Triangular mesh plot
triplot 2-D triangular plot
trisurf Triangular surface plot
1-43
1 Functions By Category
Domain Generation
griddata Data gridding and surface fitting
meshgrid Generation of X and Y arrays for 3-D plots
Color Operations
brighten Brighten or darken color map
caxis Pseudocolor axis scaling
colorbar Display color bar (color scale)
colordef Set up color defaults
colormap Set the color look-up table (list of colormaps)
graymon Graphics figure defaults set for grayscale monitor
hsv2rgb Hue-saturation-value to red-green-blue conversion
rgb2hsv RGB to HSVconversion
rgbplot Plot color map
shading Color shading mode
spinmap Spin the colormap
surfnorm 3-D surface normals
whitebg Change axes background color for plots
Colormaps
autumn Shades of red and yellow color map
bone Gray-scale with a tinge of blue color map
contrast Gray color map to enhance image contrast
cool Shades of cyan and magenta color map
copper Linear copper-tone color map
flag Alternating red, white, blue, and black color map
gray Linear gray-scale color map
hot Black-red-yellow-white color map
hsv Hue-saturation-value (HSV) color map
jet Variant of HSV
lines Line color colormap
prism Colormap of prism colors
spring Shades of magenta and yellow color map
summer Shades of green and yellow colormap
winter Shades of blue and green color map
View Control
• Controlling the Camera Viewpoint
• Setting the Aspect Ratio and Axis Limits
• Object Manipulation
1-44
3-D Visualization
• Selecting Region of Interest
Controlling the Camera Viewpoint
camdolly Move camera position and target
camlookat View specific objects
camorbit Orbit about camera target
campan Rotate camera target about camera position
campos Set or get camera position
camproj Set or get projection type
camroll Rotate camera about viewing axis
camtarget Set or get camera target
camup Set or get camera up-vector
camva Set or get camera view angle
camzoom Zoom camera in or out
view 3-D graph viewpoint specification.
viewmtx Generate view transformation matrices
Setting the Aspect Ratio and Axis Limits
daspect Set or get data aspect ratio
pbaspect Set or get plot box aspect ratio
xlim Set or get the current x-axis limits
ylim Set or get the current y-axis limits
zlim Set or get the current z-axis limits
Object Manipulation
reset Reset axis or figure
rotate3d Interactively rotate the view of a 3-D plot
selectmoveresizeInteractively select, move, or resize objects
zoom Zoom in and out on a 2-D plot
Selecting Region of Interest
dragrect Drag XOR rectangles with mouse
rbbox Rubberband box
Lighting
camlight Cerate or position Light
light Light object creation function
lightangle Position light in sphereical coordinates
lighting Lighting mode
material Material reflectance mode
1-45
1 Functions By Category
Transparency
alpha Set or query transparency properties for objects in current axes
alphamap Specify the figure alphamap
alim Set or query the axes alpha limits
Volume Visualization
coneplot Plot velocity vectors as cones in 3-D vector field
contourslice Draw contours in volume slice plane
curl Compute curl and angular velocity of vector field
divergence Compute divergence of vector field
flow Generate scalar volume data
interpstreamspeedInterpolate streamline vertices from vector-field magnitudes
isocaps Compute isosurface end-cap geometry
isocolors Compute colors of isosurface vertices
isonormals Compute normals of isosurface vertices
isosurface Extract isosurface data from volume data
reducepatch Reduce number of patch faces
reducevolume Reduce number of elements in volume data set
shrinkfaces Reduce size of patch faces
slice Draw slice planes in volume
smooth3 Smooth 3-D data
stream2 Compute 2-D stream line data
stream3 Compute 3-D stream line data
streamline Draw stream lines from 2- or 3-D vector data
streamparticlesDraws stream particles from vector volume data
streamribbon Draws stream ribbons from vector volume data
streamslice Draws well-spaced stream lines from vector volume data
streamtube Draws stream tubes from vector volume data
surf2patch Convert surface data to patch data
subvolume Extract subset of volume data set
volumebounds Return coordinate and color limits for volume (scalar and vector)
1-46