如何从corrplot()MATLAB中删除X和Y标签

时间:2018-11-07 23:44:54

标签: matlab

corrplot(T(:,1:4), 'type', 'Pearson');

为corrplot分配一个句柄只会生成一个4x4的变量关联矩阵。

我试图这样做。

fh = corrplot(T(:,1:4), 'type', 'Pearson');
th = findall(fh, 'type', 'text', 'String', '{\bf Correlation Matrix}'); 
th.String = '';

但是它不起作用,如何从该函数中删除X和Y标签。

1 个答案:

答案 0 :(得分:0)

一种更简单的方法可能是首先获取创建的Axes对象的所有句柄(因为我相信corrplot创建了多个子图):

hAxes = findall(gcf, 'Type', 'Axes');

一旦您拥有所有Axes对象的句柄,就应该很容易清除它们的x和y标签(以及标题,如果需要的话):

set([hAxes.XLabel], 'String', '');
set([hAxes.YLabel], 'String', '');
set([hAxes.Title], 'String', '');