How do I add a bode plot to an existing bode plot within a subplot in MATLAB?

45 views (last 30 days)
When I create a set of subplots using BODE function and try to add a new system to the first subplot, the first set of bode plots disappears. This occurs for any of the LTIVIEW plottypes. For example:
subplot(211);
bode(sys1);
hold on;
subplot(212);
bode(sys2);
hold on;
subplot(211);
bode(sys3);
reproduces the behavior.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 27 Jun 2009
To plot a new set of bode plots on the existing subplots, while preserving the previous plots, use the handle to the subplot. This will allow bode(sys1) and bode(sys3) on the same set of axes after producing a new subplot - bode(sys2) - between the first and third subplots. The following code illustrates this:
h1 = subplot(211);
bode(sys1);
hold on;
h2 = subplot(212);
bode(sys2);
hold on;
set(gcf,'currentaxes',h1);
bode(sys3);

More Answers (0)

Products


Release

R14SP1

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!