问题
I am generating a number of plots in MATLAB. The axis labels and the tick labels are currently too small when included in my final document. I would like to change the font size for both axis labels and tick labels while also setting a new default typeface. I have tried the FontSize
and FontName
name value pair but strangely see no effect on the exported .eps files; also this method is somewhat impractical because I am generating a large number of plots.
Any suggestions would be greatly appreciated.
回答1:
You can use findobj
to programmatically edit all figures.
For example:
ah = findobj(,'Type','axes'); % get all axes
set(ah,'FontSize',Whatever); %this will change all the tick labels
for m=1:numel(ah) % go over all axes
xlabel_handle = get(ah(m),'xlabel');
set(xlabel_handle,'FontSize',Whatever); % this will change only the label
%repeat for other labels if you wish
end
来源:https://stackoverflow.com/questions/29716854/easy-way-to-programmatically-change-all-font-types-and-sizes-in-all-figures-in-m