Amber, it looks like you are creating a figure twice and only applying hold on to the first, while plotting to the second. Try placing the hold on command just before you use the plot function. Additionally, to help avoid potentially issues that can arise due to the new figure not having an axes currently in the frame, create a blank axes in the figure just before the hold on command.
...
figure
axes
hold on
plot( ...
...
Additionally, for improved control in your code when using graphics objects, you can assign object handles to variables and then specify which object you want to perform the function on.
hFig = figure;
hAx = axes(hFig);
hold(hAx,'on');
plot(hAx, ...
0 Comments
Sign in to comment.