| Products & Services | Industries | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → MATLAB |
| Contents | Index |
| Learn more about MATLAB |
![]()
To graph selected variables, use the Plot Selector
in the Workspace Browser,
or use the Figure Palette Plot Catalog. Manipulate graphs in plot edit mode with the Property Editor. For details,
see Plotting Tools
— Interactive Plotting in the MATLAB Graphics
documentation and Creating Graphics
from the Workspace Browser in the MATLAB Desktop Tools
documentation.
stem3(Z)
stem3(X,Y,Z)
stem3(...,'fill')
stem3(...,LineSpec)
h = stem3(...)
hlines = stem3('v6',...)
Three-dimensional stem plots display lines extending from the x-y plane. A circle (the default) or other marker symbol whose z-position represents the data value terminates each stem.
stem3(Z) plots the data sequence Z as stems that extend from the x-y plane. x and y are generated automatically. When Z is a row vector, stem3 plots all elements at equally spaced x values against the same y value. When Z is a column vector, stem3 plots all elements at equally spaced y values against the same x value.
stem3(X,Y,Z) plots the data sequence Z at values specified by X and Y. X, Y, and Z must all be vectors or matrices of the same size.
stem3(...,'fill') specifies whether to color the interior of the circle at the end of the stem.
stem3(...,LineSpec) specifies the line style, marker symbol, and color for the stems. See LineSpec for more information.
h = stem3(...) returns handles to stemseries graphics objects.
hlines = stem3('v6',...) returns the handles of line objects instead of stemseries objects for compatibility with MATLAB 6.5 and earlier.
Note The v6 option enables users of Version 7.x of MATLAB to create FIG-files that previous versions can open. It is obsolete and will be removed in a future version of MATLAB. |
See Plot Objects and Backward Compatibility for more information.
Create a three-dimensional stem plot to visualize a function of two variables.
X = linspace(0,1,10); Y = X./2; Z = sin(X) + cos(Y); stem3(X,Y,Z,'fill') view(-25,30)

Discrete Data Plots for related functions
Stemseries Properties for descriptions of properties
Three-Dimensional Stem Plots for more examples
![]() | stem | Stemseries Properties | ![]() |

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |