如何从 Matlab 中的 corrplot 中删除轴单位标签

How do you remove the axes unit labels from a corrplot in Matlab

当我在 Matlab 中使用 corrplot 函数时,x 轴和 y 轴上的单位标签看起来很糟糕。 我试过了 set(gca,'XTickLabel',[]); 但它没有用。 有什么想法吗?

在我没有事先调查的情况下,我建议将 gca 分配给您选择的变量,然后浏览 Children 直到到达 structure/class 显示您在绘图本身上找到的 TickLabels。然后将它们设置为空集 []。所以,像这样:

a = gca; b = a.Children; %Analise b 的属性 set(b, 'XTickLabel',[]);

再说一次,不是说第一个child有你要引爆的场。只是建议解决问题的方法。

问题是 gca 仅 returns 当前轴,但 corrplot 创建 多个 axes 对象。您需要 select 所有这些并将 'XTickLabel' 设置为 []。您可以使用 findall 获取所有 axes 对象的句柄。

set(findall(gcf, 'type', 'axes'), 'XTickLabel', [])