Appendix B
The tables in this appendix, B-1 through B-5, list each of the plotting routines in MATLAB with a brief description and an example. To save space, some entries show a single encompassing example for multiple commands. An example may also use an ellipsis (…) to show the continuation of a pattern. To assist you, the code includes several functions to generate test matrices, for example, rand()
, magic()
, peaks()
, cylinder()
, ellipsoid()
, and sphere()
. It’s also important to note that MATLAB is always changing and that some functions, like ezpolar()
, are eventually going to go away. After all, many of the other ez* functions have retired and are now sipping beverages on a sandy beach on a tropical island.
TABLE B-1 Basic Plotting Routines
Routine |
Description |
Example |
---|---|---|
|
Just like |
|
|
Plots data passed in by vectors |
|
|
Plots data where |
|
|
Like |
|
|
Plots the expression or function |
|
|
Plots data on a log scale on both x- and y-axes — |
|
|
X-axis data is on a log scale and the y-axis is on a linear scale — |
|
|
Y-axis data is on a log scale and x-axis linear — |
|
TABLE B-2 Beyond Basics
Routine |
Description |
Example |
---|---|---|
|
Acts just like |
|
|
Creates a standard bar chart that can handle both grouping and stacking |
|
|
Just like |
|
|
Adds a little 3D pizazz to a standard bar chart |
|
|
Creates a 3D horizontal bar chart |
|
|
Like |
|
|
Creates a |
|
|
Fills polygons (vector inputs define vertices) with the specified color |
|
|
Creates a standard pie chart |
|
|
Adds some 3D pizazz to |
|
|
Creates a polar plot like |
|
TABLE B-3 Statistical Plotting Routines
Routine |
Description |
Example |
---|---|---|
|
Like |
|
|
Creates a histogram — a bar chart showing the frequency of occurrence of data vs. value. These two routines handle the bins differently |
|
|
Plots |
|
|
Like |
|
|
Related to |
|
|
Like |
|
|
Like |
|
|
A cross between |
|
|
A bar chart arranged with the highest bars first |
|
|
A |
|
|
A |
|
TABLE B-4 3D Graphics
Routine |
Description |
Example |
---|---|---|
|
Creates a contour plot with matrix arguments |
|
|
Same as |
|
|
Same as |
|
|
Creates a wireframe mesh surface |
|
|
Wireframe mesh with contour |
|
|
Wireframe mesh with a curtain around the plot |
|
|
Shows values of the matrix as colors |
|
|
Same as |
|
|
Creates a filled surface |
|
|
Same as |
|
|
Like |
|
|
Plots the function as a contour |
|
|
Like |
|
|
Plots the function as a mesh |
|
|
Plots a series of three functions expressing x-, y-, and z-axes as a parametric curve |
|
|
Plots the function as a 3D surface |
|
|
Like |
|
|
Like |
|
|
Stem plot of 3D data |
|
|
Creates surface plot with normal vectors |
|
TABLE B-5 Vector Fields
Routine |
Description |
Example |
---|---|---|
|
Like |
|
|
Like |
|
|
Like |
|
|
Like streamline, but plots tubes (cylindrical 3D flow lines) |
|
|
Similar to |
|
|
Works like |
|
|
Plots line from the vector field; the example plots 2D |
18.220.178.207