new2matlab
new2matlab

Reputation: 37

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

When I use the corrplot function in Matlab, the unit labels on the x and y axes look terrible. I tried set(gca,'XTickLabel',[]); but it didn't work. Any ideas?

Upvotes: 0

Views: 679

Answers (2)

Suever
Suever

Reputation: 65430

The issue is that gca only returns the current axes, but corrplot creates multiple axes objects. You'll want to select all of them and set the 'XTickLabel' to []. You can use findall to get the handles to all of the axes objects.

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

Upvotes: 2

Texmex
Texmex

Reputation: 61

Without any prior investigation from my part, I would recommend to assign the gca to a variable of your choosing, and then navigate through the Children until you get to a structure/class that presents the TickLabels you are finding on the plot itself. Then set those as empty sets []. So, something like this:

a = gca; b = a.Children; %Analise b's properties set(b, 'XTickLabel',[]);

Again, not stating that the first child has the field you want to set off. Just suggesting a way to go about the problem.

Upvotes: 0

Related Questions