Change look of margin plot
26 ビュー (過去 30 日間)
古いコメントを表示
I am using the margin function in matlab to plot the frequency response of a transfer funtion.
I have changed i names on the axes and i have tried to change the font size of the numbers on the axis.
I works with some of the numbers but not all. Is there a solution to this problem.
I want all numbers on the axes to be of size 14.
hFig = figure;
margin(G_p);
ax = gca;
ax.FontSize = 14;
fontname(gcf,"Times")
title("","FontSize",35,"FontName","Times")
labels = findall(hFig,'Type','Text');
set(labels(2),'String','Frequency [rad/s]',"FontSize",24,"FontName","Times");
set(labels(6),'String','Phase [deg]',"FontSize",24,"FontName","Times");
set(labels(9),'String','Magnitude [dB]',"FontSize",24,"FontName","Times");
xlim([10^-1 10^4])
fontname(gcf,"Times")
grid

0 件のコメント
採用された回答
Jiri Hajek
2022 年 11 月 21 日
Hi, this special plot apparently has a specific structure. I'd suggest to try and analyze the properties of your plot object. It seems probable that the gca object will have in its structure two children axes objects and you need to set their FontSize properties. I suggest to try to search for all objects in your figure that have a FontSize property.
Hmatch = findobj(hFig,'-property',FontSize)
And then set the property for all found objects.
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!