尝试这个
addYLabel(clusterobj , 'YourLabel', 'FontSize', 4)
这将改变将出现在绘图右侧的 y 标签“YourLabel”的大小。
但是,如果要更改所有的文本标签,那么路要长一些。使用我在TMW 支持页面中找到的代码:
% Make all handles visible. This is necessary because clustergram
% objects are created with 'HandleVisibility' property set to 'off'.
set(0,'ShowHiddenHandles','on')
% Get all handles from root
allhnds = get(0,'Children');
% Find the handles that correspond to clustergram objects
cgfigidx = strmatch('Clustergram',get(allhnds,'Tag'));
cffighnd = allhnds(cgfigidx);
fch = get(cffighnd,'Children');
fch = fch(strmatch('axes',get(fch,'Type')));
% Find all the text objects
txtobj = findall(fch,'Type','Text');
% Set the font size of all text objects in clustergram (at last!)
set(txtobj,'FontSize',5)
编辑:
只需阅读@Jonas 评论,有一种更简单、更优雅的方式,而不是复杂的代码:
figureHandle = gcf;
%# make all text in the figure to size 14 and bold
set(findall(figureHandle,'type','text'),'fontSize',4,'fontWeight','bold')
起首,乔纳斯先生。