【问题标题】:Change the fontsize of the axis of a bode plot in octave?以八度更改波特图轴的字体大小?
【发布时间】:2021-08-30 20:24:25
【问题描述】:

这是八度脚本

clear all;
close all;

pkg load control;

Ri1 = Ri2 = 10e6;
Cin = 2e-6;

R1 = 9e3;
R2 = 1e3;
Rl = 100;
C = 2e-6;

tau1 = ((Ri1*Ri2)/(Ri1 + Ri2)) * Cin;

H = tf([tau1 0],[tau1 1]);

Gain = R2/(R1+R2);

G = tf([C*Rl 0],[(C*R1 + C*(R1*R2)/(R1+R2)) 1]);

G = Gain * G;

bode(G*H);
set(gca,'FontSize',20,'Fontname','arial');
xlabel('Frequency','FontSize',20,'FontWeight','bold');

并且正在生成这个图表:

bode plot

有谁知道为什么只有第二个图会改变字体大小以及如何在两个图中进行更改?

【问题讨论】:

  • 如果可能的话可以单独绘制

标签: matlab plot octave


【解决方案1】:

只需重新标记 y 轴和标题即可帮助您按照最终图表的预期更改字体。

bode(G*H);
%set(gca,'FontSize',20,'Fontname','arial');
xlabel('Frequency','FontSize',20,'FontWeight','bold');
ylabel('Phase','FontSize',20,'FontWeight','bold');
title('Bode Diagram','FontSize',20,'FontWeight','bold')

但使用 set(gca,~) 控制每个绘图的数据标签有些棘手。详细信息可以参考这里的回答(How do I reach first and second plots from bode())。

我认为单独提取相位和幅度图并绘制它们以独立控制要容易得多。

[magn,phas,w]=bode(G*H);

figure()
subplot(2,1,1)
plot(w, magn(:))
set(gca,'FontSize',20,'Fontname','arial');
title('Magnitude')
subplot(2,1,2)
plot(w,phas(:))
set(gca,'FontSize',20,'Fontname','arial');
title('Phase')

【讨论】:

    猜你喜欢
    • 2021-03-10
    • 1970-01-01
    • 2010-12-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-09-28
    • 2016-04-25
    • 2019-11-18
    相关资源
    最近更新 更多