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

    %% Change Line Styles
% Plot two data sets using a graph with two _y_-axes. Change the line
% styles. Starting in R2014b, you can use dot notation to set properties.
% If you are using an earlier release, use the
% <docid:matlab_ref.f67-432995> function instead.

% Copyright 2015 The MathWorks, Inc.


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

[hAx,hLine1,hLine2] = plotyy(x,y1,x,y2);
hLine1.LineStyle = '--';
hLine2.LineStyle = ':';