Change look of margin plot

22 次查看(过去 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

采纳的回答

Jiri Hajek
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 个)

类别

Help CenterFile Exchange 中查找有关 Plot Customization 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by