how can I make a fontsize change on a figure and its children as well?

8 次查看(过去 30 天)
I have a figure with more than 2 axis and it could have many children in it. How can I change the font size for all parts of the figure? my code is so far:( it doesn't change one of the axis)
set(gcf,'paperunits','centimeters');
set(gcf,'paperposition',[2 2 a(1) a(1)*(1/a(2))]);
textobj=findobj('type','text');
set(textobj,'fontunits','points');
set(textobj,'fontsize',5);
set(findall(gcf,'property','fontsize'),'fontsize',5);
set(gca,'fontsize',5);
set(findall(gca,'type','text'),'fontsize',5);
set(findall(gcf,'type','text'),'fontsize',5);
new_name=strrep([pathName name],'.fig','.png');
child=get(gcf,'children');
for y=1:length(child)
chi=child(y);
set(gcf,'chi','fontsize',11);
end

采纳的回答

Jan
Jan 2014-1-21
for y = 1:length(child)
chi=child(y);
set(chi, 'fontsize', 11); % Not set(gcf,'chi','fontsize',11)
end
When you get an error message, posting this in the forum will help to assist you.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 App Building 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by