How do I add a bode plot to an existing bode plot within a subplot in MATLAB?
45 views (last 30 days)
Show older comments
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
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);
0 Comments
More Answers (0)
See Also
Categories
Find more on Plot Customization in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!