%% Add Line Plot to Existing Graph
% Create a line plot. Then, use |hold on| to add a second line plot without
% deleting the existing plot. The new plot uses the next color and line
% style based on the |ColorOrder| and |LineStyleOrder| properties of the
% axes. 

% Copyright 2015 The MathWorks, Inc.


x = linspace(-pi,pi);
y1 = sin(x);
y2 = cos(x);

plot(x,y1)
hold on
plot(x,y2)


%%
% Reset the hold state to off so that new plots delete existing plots. New
% plots start from the beginning of the color order and line style order.
hold off
y3 = sin(2*x);
plot(x,y3)
