File last modified 4 January 1999
MatLab has many powerful data representation and visualization tools built into it, with the issue of version 5 the folks at MathWorks have given us an almost complete visualization environment. In fact, some people claim with MatLab v.5, no other graphics software should ever be needed. While we don't completely agree, it is true that MatLab has come a long way in providing to the serious data analyzer a great wealth of visualization tools.
For most basic structural components, MatLab has specialized help files and graphical display of data and results is no exception. By simply typing:
help graph2d
MatLab will list all of the pertinent functions it has that relate to graphing two-dimensional data (many of which you have already seen):
Two dimensional graphs.
Elementary X-Y graphs.
plot - Linear plot.
loglog - Log-log scale plot.
semilogx - Semi-log scale plot.
semilogy - Semi-log scale plot.
polar - Polar coordinate plot.
plotyy - Graphs with y tick labels on the left and right.
Axis control.
axis - Control axis scaling and appearance.
zoom - Zoom in and out on a 2-D plot.
grid - Grid lines.
box - Axis box.
hold - Hold current graph.
axes - Create axes in arbitrary positions.
subplot - Create axes in tiled positions.
Graph annotation.
legend - Graph legend.
title - Graph title.
xlabel - X-axis label.
ylabel - Y-axis label.
text - Text annotation.
gtext - Place text with mouse.
Hardcopy and printing.
print - Print graph or SIMULINK system; or save graph to M-file.
printopt - Printer defaults
orient - Set paper orientation.
See also GRAPH3D, SPECGRAPH.
The brief description that follows each one is a good starting place. We strongly recommend that if those few words sound interesting and possibly applicable to your current visualization problem, that you get the complete help file listing for that function and then try it! The small investment in your time can be paid back many times over by finding the right tool for the right job at the beginning of the job.
Likewise, the three-dimensional plotting routines also have their own special help file, type:
help graph3d
and MatLab will respond with:
Three dimensional graphs.
Elementary 3-D plots.
plot3 - Plot lines and points in 3-D space.
mesh - 3-D mesh surface.
surf - 3-D colored surface.
fill3 - Filled 3-D polygons.
Color control.
colormap - Color look-up table.
caxis - Pseudocolor axis scaling.
shading - Color shading mode.
hidden - Mesh hidden line removal mode.
brighten - Brighten or darken color map.
Lighting.
surfl - 3-D shaded surface with lighting.
lighting - Lighting mode.
material - Material reflectance mode.
specular - Specular reflectance.
diffuse - Diffuse reflectance.
surfnorm - Surface normals.
Color maps.
hsv - Hue-saturation-value color map.
hot - Black-red-yellow-white color map.
gray - Linear gray-scale color map.
bone - Gray-scale with tinge of blue color map.
copper - Linear copper-tone color map.
pink - Pastel shades of pink color map.
white - All white color map.
flag - Alternating red, white, blue, and black color map.
lines - Color map with the line colors.
colorcube - Enhanced color-cube color map.
jet - Variant of HSV.
prism - Prism color map.
cool - Shades of cyan and magenta color map.
autumn - Shades of red and yellow color map.
spring - Shades of magenta and yellow color map.
winter - Shades of blue and green color map.
summer - Shades of green and yellow color map.
Axis control.
axis - Control axis scaling and appearance.
zoom - Zoom in and out on a 2-D plot.
grid - Grid lines.
box - Axis box.
hold - Hold current graph.
axes - Create axes in arbitrary positions.
subplot - Create axes in tiled positions.
Viewpoint control.
view - 3-D graph viewpoint specification.
viewmtx - View transformation matrix.
rotate3d - Interactively rotate view of 3-D plot.
Graph annotation.
title - Graph title.
xlabel - X-axis label.
ylabel - Y-axis label.
zlabel - Z-axis label.
colorbar - Display color bar (color scale).
text - Text annotation.
gtext - Mouse placement of text.
Hardcopy and printing.
print - Print graph or SIMULINK system; or save graph to M-file.
printopt - Printer defaults.
orient - Set paper orientation.
See also GRAPH2D, SPECGRAPH.
While we played around with some of these functions in our problem sets and example m-files, we did not even begin to scratch the surface of all the varied and wonderful types of plots that can be made by exploiting the three-dimensional plotting routines of MatLab.
But there's even more! One of the very powerful abilities of MatLab is the ability to add motion to your graphic. This is done with the MatLab function movie. One actually builds a special kind of matrix with the MatLab function getframe and then can "play" the movie matrix on your screen. In addition, there are publically available software that will take MatLab's movie matrices and turn them intp mpeg files for animation on the web, a very powerful addition to anyone's web page. But be careful, some of these mpeg files can become very large and few people have the patience (or ability) to download 20MB mpeg files just to see your choreography. Remember the "motion" can be in time or space and it is just one of the ways MatLab gives you to put three (or higher)-dimensional data onto an inherently two-dimensional screen.
In addition to movie, MatLab has other ways to enhance the visualization of higher-dimensional data on the 2-D screen. Most of these techniques make use of the "slice-and-dice" abilities of manipulating n-dimensional matrices. Since the only limitation on the dimensionality of matrices in MatLab now is the limits imposed by the amount RAM your computational platform has access to, many compact and highly efficient calculations can be performed by MatLab. However, the results are left in an n-dimensional space that is hard to imagine and even more difficult to render on a two-dimensional surface.
One way of dealing with this higher dimensionality is to extract lower-dimensional "slices" from the original data. By examining several 2-D plots of a n-D process one can gain significant insight into the nature of the process just analyzed or simulated. The same can be said for the extraction of multiple 3-D "slices" of n-D data. Additionally the use of color, arrows and perspective can cram more and more information in a plot. But beware! One can cram so much extra information into a plot that it becomes so busy that only the most intimately familiar can interpret what is being presented (i.e. you).
GoTo Next Section