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

1 visualización (últimos 30 días)
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

Respuesta aceptada

Jan
Jan el 21 de En. de 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.

Más respuestas (0)

Categorías

Más información sobre App Building en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by