www.gusucode.com > graphics 案例源码程序 matlab代码 > graphics/SpecifyStemLocationswithVectorInputsExample.m

    %% Specify Stem Locations with Vector Inputs  
% Create a 3-D stem plot and specify the stem locations along a curve. Use
% |view| to adjust the angle of the axes in the figure.   

% Copyright 2015 The MathWorks, Inc.


%%  
figure
X = linspace(-5,5,60);
Y = cos(X);
Z = X.^2;
stem3(X,Y,Z)
view(-8,30)    

%%
% |X| and |Y| determine the stem locations. |Z| determines the marker heights.