Change the title of a Bode Plot
97 次查看(过去 30 天)
显示 更早的评论
Hi all,
I've been working with the Bode Plot options in MATLAB, speciffically bodeplot so as to customise it a bit more.
I've manged to figure out how to change axis limts and so on, but I canot figure out how to change the title of the plot to have it reflect the following title for example; "Bode plot of "
I can get it to work for a plot using the plot command, but not for the bodeplot. I can index into the structure, but can't get the latex to work in there, it just comes back with text, and not the desired title. I've only just started working with LaTex within MATLAB, so I guess my issue is there.
Any help appreciated.
Thanks
Gerard
clear;
clc;
Gsys = tf(2,[0.25 1]);
h = bodeplot(Gsys);
t = '$\frac{8}{{{s}^{2}}+4s}$';
p = getoptions(h);
p.XLim = {[0.1 100]};
p.YLim(1) = {[-60 30]};
p.YLim(2) = {[-180 90]};
p.Title.String = {['t','interpreter','latex']};
setoptions(h,p);
grid
axes_handles = findall(gcf, 'type', 'axes');
leg = legend(axes_handles(3),'$\frac{8}{s(s+4)}$','interpreter','latex');
set(leg,'FontSize',17);
set(leg,'Location','southwest');
hold on
0 个评论
采纳的回答
Adam Danz
2022-3-15
p.Title.String = t;
p.Title.Interpreter = 'latex';
and you'll probably want
p.Title.FontSize = 20;
4 个评论
更多回答(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!