Filter löschen
Filter löschen

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

8 Ansichten (letzte 30 Tage)
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

Akzeptierte Antwort

Jan
Jan am 21 Jan. 2014
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.

Weitere Antworten (0)

Kategorien

Mehr zu App Building finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by