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

    %% Combine Different Types of Plots
% Plot two data sets using a graph with two y-axes. Use a line plot for the data associated
% with the left _y_-axes. Use a stem plot for the data associated with the
% right _y_-axes.

% Copyright 2015 The MathWorks, Inc.


x = 0:0.1:10;
y1 = 200*exp(-0.05*x).*sin(x);
y2 = 0.8*exp(-0.5*x).*sin(10*x);

figure 
plotyy(x,y1,x,y2,'plot','stem')