Azzera filtri
Azzera filtri

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

8 visualizzazioni (ultimi 30 giorni)
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

Risposta accettata

Jan
Jan il 21 Gen 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.

Più risposte (0)

Categorie

Scopri di più su App Building in Help Center e File Exchange

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by