How do I add a bode plot to an existing bode plot within a subplot in MATLAB?
45 次查看(过去 30 天)
显示 更早的评论
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.
采纳的回答
MathWorks Support Team
2009-6-27
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 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Plot Customization 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!